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

WPF x:static的使用的更多相关文章

  1. WPF:获取DataGrid控件单元格DataGridCell

    转载:http://blog.csdn.net/jhqin/article/details/7645357 /* ------------------------------------------- ...

  2. 遍历WPF DataGrid单元格

    using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Media; ...

  3. WPF 获得DataGridRow和 DataGridCell的方法

    原文:WPF 获得DataGridRow和 DataGridCell的方法 原文地址 简介 在WPF中,DataGrid控件并没有提供访问其DataGridRow或者DataGridCell的方法. ...

  4. DataGrid 得到DataGridRow 和DataGridColumn

    /* ---------------------------------------------------------- 文件名称:DataGridPlus.cs 作者:秦建辉 MSN:splash ...

  5. 使用copydata实现进程之间数据传递

    Winform to Winfrom==> 发送端==> using System; using System.Runtime.InteropServices; namespace Cop ...

  6. WPF使用X:Static做多语言支持

    让程序支持多语言,一般把需要显示的字符串保存在一个资源类的static属性中. <!--[if !supportLists]--> <!--[endif]--> 微软的WPF程 ...

  7. WPF error: does not contain a static 'Main' method suitable for an entry point

    WPF error: does not contain a static &apos;Main&apos; method suitable for an entry point doe ...

  8. WPF开发“Program '*' does not contain a static 'Main' method suitable for an entry point”错误

    WPF项目编译时出现“Program '*' does not contain a static 'Main' method suitable for an entry point”错误,   解决方 ...

  9. WPF扩展标记X:STATIC

    原文:WPF扩展标记X:STATIC public class XStaic     {         public static string Content = "确定"; ...

随机推荐

  1. Python 标准库 —— glob

    glob库是最简单的模块之一,内容非常少.用它可以查找符合特定规则的文件路径名.跟使用 windows 下的文件搜索差不多.查找文件只用到三个匹配符: "*", 匹配 0 个或多个 ...

  2. Android 自定义RadioButton样式

     上面这种3选1的效果如何做呢?用代码写? 其实有更简单的办法,忘了RadioButton有什么特性了吗? 我就用RadioButton实现了如上效果,其实很简单的. 首先定义一张background ...

  3. mycat schema.xml 配置文件详解

    <?xml version="1.0"?> <!DOCTYPE mycat:schema SYSTEM "schema.dtd"> &l ...

  4. Chrome源代码结构

    首先,开始接触Chrome的童鞋可能有一个疑惑,Chrome和Chromium是同一个东西吗?答案是,Chrome是Google官方的浏览器项目名称,Chromium是Google官方对Chrome开 ...

  5. js如何遍历表单所有控件

    js如何遍历表单所有控件 一.总结 一句话总结: 1.获取form表单里面的的所有元素:通过formelement.elements,这里form元素通过name属性直接定位 var fele=for ...

  6. springboot启动tomcat报错java.lang.NoClassDefFoundError: javax/el/ELManager仅记录

    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'o ...

  7. effective c++ 条款7

    1.随着多态基类应该声明一个质virtual析构函数. 假定class由于不管是什么virtual析构函数, 它应该有一个virtual析构函数. 2.classed的设计目的假设不是作为base c ...

  8. yii2框架学习一 yii安装与常见问题

    1 安装安装有两种  cpmposer 喝归档文件 安装  这里采用的归档文件安装    归档文件安装分为两种 基础末班和高级模板,这里采用高级模板  在官网或者yii-china 下载归档文件  解 ...

  9. SpringCloud学习笔记-zuul网关

    公司目前使用的是dubbo方式实现微服务,想试水改造接口层服务为Spring Cloud, 以下是网络拓补图. 第一层负载均衡可以用nginx或者zuul(即有2层zuul), 本图画的是nginx. ...

  10. Struts2——(2)配置文件、通配符

    一.Struts配置文件 (1)struts-default.xml(框架自带) 定义了一些框架自带的Result组件,拦截器组件. <package name="struts-def ...