数据绑定—Source(绑定到静态类的静态属性)
<UserControl x:Class="绑定.绑定Source"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:绑定"
mc:Ignorable="d"
d:DesignHeight="" d:DesignWidth="">
<Grid>
<Button Content="{Binding Source={x:Static local:BingdingStaticPath.BindingStaticProperty}}"></Button>
</Grid>
</UserControl>
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.Navigation;
using System.Windows.Shapes;
using System.ComponentModel; namespace 绑定
{
/// <summary>
/// 绑定Source.xaml 的交互逻辑
/// </summary>
public partial class 绑定Source : UserControl
{
public 绑定Source()
{
InitializeComponent();
}
} public static class BingdingStaticPath
{
private static string _bindingStaticProperty;
public static String BindingStaticProperty
{
set
{
_bindingStaticProperty = value;
}
get
{
return _bindingStaticProperty;
}
}
static BingdingStaticPath()
{
_bindingStaticProperty = "dog";
}
}
}
数据绑定—Source(绑定到静态类的静态属性)的更多相关文章
- Silverlight数据绑定之 绑定一个int类型的属性
还就真心不会啊! 在类FunctionPanel中作如下定义: /// <summary> /// 鼠标状态 属性 /// </summary> public Dependen ...
- WPFS数据绑定(要是后台类对象的属性值发生改变,通知在“client界面与之绑定的控件值”也发生改变须要实现INotitypropertyChanged接口)
WPFS数据绑定(要是后台类对象的属性值发生改变,通知在"client界面与之绑定的控件值"也发生改变须要实现INotitypropertyChanged接口) MainWindo ...
- win10 uwp 绑定静态属性
Jasoon 大神问,如何绑定静态属性. 我们经常有静态属性,那么我们如何绑定 假如我们的ViewModel有一个静态属性 public static string CVTE { set; get; ...
- Javascript 面向对象(共有方法,私有方法,特权方法,静态属性和方法,静态类)示例讲解
一,私有属性和方法 私有方法:私有方法本身是可以访问类内部的所有属性(即私有属性和公有属性),但是私有方法是不可以在类的外部被调用. <script> /* * 私有方法:私有方法本身是可 ...
- WPF 绑定到静态属性(4.5)
1. 声明静态事件 /// <summary> /// 静态属性通知 /// </summary> public static event EventHandler<Pr ...
- JS面向对象(3) -- Object类,静态属性,闭包,私有属性, call和apply的使用,继承的三种实现方法
相关链接: JS面向对象(1) -- 简介,入门,系统常用类,自定义类,constructor,typeof,instanceof,对象在内存中的表现形式 JS面向对象(2) -- this的使用,对 ...
- day25、 静态属性、类方法、静态方法、组合、继承、
一. 静态属性.类方法.静态方法 1.1静态属性 class Room: def __init__(self,name,owner,width,length): self.name=name self ...
- js公有、私有、静态属性和方法的区别
现下,javascript大行其道,对于网站开发人员来说,javascript是必需掌据的一门语言,但随着jquery等框架的流行和使用,许多人对于原生javascript缺乏深入的理解, ...
- java中静态属性和和静态方法的继承问题 以及多态的实质
首先结论是:java中静态属性和和静态方法可以被继承,但是没有被重写(overwrite)而是被隐藏. 静态方法和属性是属于类的,调用的时候直接通过类名.方法名完成的,不需继承机制就可以调用如果子类里 ...
随机推荐
- User Agent注入攻击及防御
CloudFlare公司经常会收到客户询问为什么他们的一些请求会被 CloudFlare WAF屏蔽.最近,一位客户就提出他不能理解为什么一个访问他主页简单的 GET 请求会被 WAF 屏蔽. 下面是 ...
- 仿联想商城laravel实战---4、验证(lavarel的表单验证如何使用)
仿联想商城laravel实战---4.验证(lavarel的表单验证如何使用) 一.总结 一句话总结: 验证规则和验证信息的数组:在控制器的方法中 1.注册页面中的用户名正确(比如是否重名,字段长度是 ...
- python3 字符串属性(四)
1. S.partition(sep) -> (head, sep, tail) Search for the separator sep in S, and return the part b ...
- python3操作mysql数据库增删改查
#!/usr/bin/python3 import pymysql import types db=pymysql.connect("localhost","root&q ...
- Filter/replace - VBA
Auto filter: ActiveSheet.Range("A:F").AutoFilter Field:=3, Criteria1:="*Agent*" ...
- rabbitmq-交换机
四种交换机: direct fanout topic headers http://www.jianshu.com/p/469f4608ce5d
- 查看字符串的编码chardet
The Universal Character Encoding Detector chardet.detect("str") 返回:{‘confidence’:1.0,'enco ...
- Agc011_F Train Service Planning
先放题面,再放LHX巨佬题解 接着就是%%%.$orz.Oro.Or2.Otz.OTL.sto.rzo.Jto$.On_.○| ̄|_啊 模拟赛里直接把这道题刚掉了 一题升天·爆踩全场 这题思维跨越度已 ...
- Missing key(s) in state_dict: Unexpected key(s) in state_dict
如果加载的预训练模型之前使用了torch.nn.DataParallel(),而此时的训练并没有使用,则会出现这样的错误.解决方案有两个:1:此时的训练加入torch.nn.DataParallel( ...
- ie11
可用:document.documentMode来检测. var isIE11 = function() { var result = false; if (document.documentMode ...