路径转换

     前台代码

  xmlns:wpfApplication6="clr-namespace:WpfFormControl"

  <Button Content="{Binding Source={x:Static wpfApplication6:Title.aa},Converter={StaticResource ss}}"/>

后台

    /// <summary>
    /// Title.xaml 的交互逻辑
    /// </summary>
    public partial class Title : Window
    {
        public static string aa = "dfdf";

        public Title()
        {
            InitializeComponent();
            this.pswa.Content = Properties.Resources.psw;

        }
    }
    public class aConvert : IValueConverter
    {

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return (string)value + ":d---fd";
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
View Code

 

posted @ 2016-09-17 09:26  白色的回忆  阅读(142)  评论(0编辑  收藏  举报