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();
            }
        }
    }

  • 相关阅读:
    微信小程序入门实例
    textarea 的value值以及演示
    Think php (TP5) 批量删除全部源码
    Think php TP5 CURD 增删改查全部源码
    TP5 Think php 批量添加全部源码
    centos7 supervisor管理redis
    Centos7 设置redis开机自启
    Centos7安装gearman和php扩展
    nginx-403
    FFmpeg-截取视频图片
  • 原文地址:https://www.cnblogs.com/dxmfans/p/9434637.html
Copyright © 2011-2022 走看看