WPF 绑定属性 XAML 时间格式化

原文: WPF 绑定属性 XAML 时间格式化

XAML 时间格式化{Binding Birthday,StringFormat='yyyy-MM-dd '}

public class AssetClass : INotifyPropertyChanged

    {
        private String myClass;


        public String Class
        {
            get { return myClass; }
            set {
                myClass = value;
                RaisePropertyChangeEvent("Class");
            }
        }


        private double fund;


        public double Fund
        {
            get { return fund; }
            set {
                fund = value;
                RaisePropertyChangeEvent("Fund");
            }
        }


        private double total;


        public double Total
        {
            get { return total; }
            set {
                total = value;
                RaisePropertyChangeEvent("Total");
            }
        }


        private double benchmark;


        public double Benchmark
        {
            get { return benchmark; }
            set {
                benchmark = value;
                RaisePropertyChangeEvent("Benchmark");
            }
        }

 

        #region INotifyPropertyChanged Members


        public event PropertyChangedEventHandler PropertyChanged;


        private void RaisePropertyChangeEvent(String propertyName)
        {
            if (PropertyChanged!=null)
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            
        }


        #endregion
    }

猜你喜欢

转载自www.cnblogs.com/lonelyxmas/p/12075374.html