zoukankan      html  css  js  c++  java
  • 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();
            }
        }
    }

  • 相关阅读:
    老杳:2017年中国集成电路产业十大新闻
    RMA退货流程解决方案
    Linux
    vue.js
    NET Core度身定制的AOP框架
    Timeline
    HTTP
    MVC 常用扩展点:过滤器、模型绑定等
    装箱拆箱
    jQuery Tree
  • 原文地址:https://www.cnblogs.com/dxmfans/p/9434637.html
Copyright © 2011-2022 走看看