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

            base.OnStartup(e);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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));
 }