LocateForModelType() public static method

public static LocateForModelType ( Type modelType, DependencyObject viewLocation, object context, Func original ) : UIElement
modelType System.Type
viewLocation System.Windows.DependencyObject
context object
original Func
return System.Windows.UIElement
コード例 #1
0
ファイル: AppBootstrapper.cs プロジェクト: aluetjen/ravendb
        static void ConfigureConventions()
        {
            ConventionManager.AddElementConvention <TransitioningContentControl>(View.ModelProperty, "DataContext", null);
            ConventionManager.AddElementConvention <BusyIndicator>(BusyIndicator.IsBusyProperty, "IsBusy", null);

            var original = ViewLocator.LocateForModelType;

            ViewLocator.LocateForModelType = (t, v, c) => { return(StudioViewLocator.LocateForModelType(t, v, c, original)); };

            MessageBinder.SpecialValues["$selecteditems"] = context => {
                ListBox listBox;

                if (context.Source is ListBox)
                {
                    listBox = (ListBox)context.Source;
                }
                else
                {
                    var viewAware  = (ViewAware)context.Source.Tag;
                    var parentView = (FrameworkElement)viewAware.GetView();
                    listBox = (ListBox)parentView.FindName("DocumentPageContainer");
                }

                return(listBox.SelectedItems);
            };
        }
コード例 #2
0
ファイル: AppBootstrapper.cs プロジェクト: stgwilli/ravendb
        static void ConfigureConventions()
        {
            ConventionManager.AddElementConvention <TransitioningContentControl>(View.ModelProperty, "DataContext", null);
            ConventionManager.AddElementConvention <BusyIndicator>(BusyIndicator.IsBusyProperty, "IsBusy", null);

            var original = ViewLocator.LocateForModelType;

            ViewLocator.LocateForModelType = (t, v, c) => { return(StudioViewLocator.LocateForModelType(t, v, c, original)); };
        }