Exemplo n.º 1
0
        /// <summary>
        /// 获取结构体参数的新值
        /// </summary>
        public static T GetSValue <T>(this IPropertyChangedArgs args) where T : struct
        {
            T t = default(T);

            if (args is SPropertyArgs <T> )
            {
                SPropertyArgs <T> sArgs = (SPropertyArgs <T>)args;

                t = sArgs.value;
            }

            return(t);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取类参数的新值
        /// </summary>
        public static T GetCValue <T>(this IPropertyChangedArgs args) where T : class
        {
            T t = null;

            if (args is CPropertyArgs <T> )
            {
                CPropertyArgs <T> cArgs = args as CPropertyArgs <T>;

                t = cArgs.value;
            }

            return(t);
        }
Exemplo n.º 3
0
    protected override void ViewModelPropertyChanged(string propertyName, IPropertyChangedArgs args)
    {
        if (args == null)
        {
            return;
        }

        switch (propertyName)
        {
        case "Text":
            Text = args.GetCValue <string>();
            break;
        }
    }
Exemplo n.º 4
0
        /// <summary>
        /// 获取结构体参数的旧值
        /// </summary>
        public static void GetSValue <T>(this IPropertyChangedArgs args, out T oldValue, out T newValue) where T : struct
        {
            oldValue = default(T);

            newValue = default(T);

            if (args is SPropertyArgsB <T> )
            {
                SPropertyArgsB <T> sArgs = (SPropertyArgsB <T>)args;

                oldValue = sArgs.oldValue;

                newValue = sArgs.newValue;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 获取类参数的旧值
        /// </summary>
        public static void GetCValue <T>(this IPropertyChangedArgs args, out T oldValue, out T newValue) where T : class
        {
            oldValue = null;

            newValue = null;

            if (args is CPropertyArgsB <T> )
            {
                CPropertyArgsB <T> cArgs = args as CPropertyArgsB <T>;

                oldValue = cArgs.oldValue;

                newValue = cArgs.newValue;
            }
        }
Exemplo n.º 6
0
 private static void UpperSourceChanged(AppView o, IPropertyChangedArgs<object> args)
 {
     o.upperView.ItemsSource = args.NewValue;
 }
Exemplo n.º 7
0
 private static void IsPaneOpenChanged(AppView o, IPropertyChangedArgs<bool> args)
 {
     o.splitView.IsPaneOpen = args.NewValue;
 }
Exemplo n.º 8
0
 private static void FrameContentChanged(AppView o, IPropertyChangedArgs<object> args)
 {
     o.frame.Content = args.NewValue;
 }
Exemplo n.º 9
0
 protected abstract void OnModelPropertyChanged(string propertyName, IPropertyChangedArgs args);
Exemplo n.º 10
0
 private static void WidthChanged(FrameworkElement element, IPropertyChangedArgs<string> args)
 {
     element.SetBinding(FrameworkElement.WidthProperty, args.NewValue);
 }
Exemplo n.º 11
0
 private static void ContentChanged(ContentControl control, IPropertyChangedArgs<string> args)
 {
     control.SetBinding(ContentControl.ContentProperty, args.NewValue);
 }
Exemplo n.º 12
0
 protected override void ViewModelPropertyChanged(string propertyName, IPropertyChangedArgs args)
 {
 }