protected override void OnStartup(StartupEventArgs e)
        {
            ViewModel = CreateApplicationViewModel();
            Bootstrapper.Run(CreateModules().ToArray());
            FrameBinder.Bind(this, ViewModel);

            base.OnStartup(e);
        }
예제 #2
0
        private TabItem CreateTabItem(ViewModel model)
        {
            var item = new TabItem();

            FrameBinder.Bind(item, model);

            var view = (IBindableView)Service <IViewFactory> .Get().CreateView(model.GetPrefix(), model.GetViewStyle());

            view.ViewModel = model;
            item.Content   = view;

            return(item);
        }
예제 #3
0
        private static void OnBind(DependencyObject target, DependencyPropertyChangedEventArgs args)
        {
            var binding = FrameBinder.GetBindedFrame(target);

            if (binding == args.NewValue)
            {
                return;
            }

            if (binding != null)
            {
                FrameBinder.Unbind(target);
            }

            if (args.NewValue != null)
            {
                FrameBinder.Bind(target, args.NewValue);
            }
        }
예제 #4
0
        public static void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs args)
        {
            var binding = FrameBinder.GetBindedFrame(sender);

            if (binding == args.NewValue)
            {
                return;
            }

            if (binding != null)
            {
                FrameBinder.Unbind(sender);
            }

            if (args.NewValue != null)
            {
                FrameBinder.Bind(sender, args.NewValue);
            }
        }
예제 #5
0
 public ArgBody(Datum argDatum, Datum body)
 {
     this.argDatum = argDatum;
     this.binding  = LexicalBinder.Create(argDatum);
     this.body     = body;
 }
 public static T GetBindedFrame <T>(this FrameworkElement element)
     where T : class
 {
     return((T)FrameBinder.GetBindedFrame(element));
 }
 public static object GetBindedFrame(this FrameworkElement element)
 {
     return(FrameBinder.GetBindedFrame(element));
 }