• WPF x:static的使用


     <Window x:Class="XamlTest.Window1"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:sys="clr-namespace:System;assembly=mscorlib"
            xmlns:local="clr-namespace:XamlTest"
            Title="Window1" Height="300" Width="300">
        <Grid>
            <StackPanel>
            
                <TextBox Text="{x:Static local:Window1.title}"></TextBox>
                
            </StackPanel>
        </Grid>
    </Window>


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Shapes;


    namespace XamlTest
    {
        /// <summary>
        /// Interaction logic for Window1.xaml
        /// </summary>
        public partial class Window1 : Window
        {
            public static string title = "wo de title";
            public Window1()
            {
                InitializeComponent();
            }
        }
    }

  • 相关阅读:
    MySQL7:性能优化
    MySQL6:视图
    MySQL5:触发器
    MySQL4:索引
    MySQL3:存储过程和函数
    MySQL1:MySQL函数汇总
    MySQL2:四种MySQL存储引擎
    Spring7:基于注解的Spring MVC(下篇)
    Spring6:基于注解的Spring MVC(上篇)
    Linux查看端口号
  • 原文地址:https://www.cnblogs.com/dxmfans/p/9434637.html
Copyright © 2020-2023  润新知