Exemplo n.º 1
0
        internal static ITypeInfo RequestType(PropertyEditorPanel owner, AsyncValue <IReadOnlyDictionary <IAssemblyInfo, ILookup <string, ITypeInfo> > > assignableTypes)
        {
            Window hostWindow = Window.GetWindow(owner);

            var w = new TypeSelectorWindow(owner.Resources.MergedDictionaries, assignableTypes)
            {
                Owner = hostWindow,
            };

            w.Resources.MergedDictionaries.AddItems(owner.Resources.MergedDictionaries);

            if (!w.ShowDialog() ?? false)
            {
                return(null);
            }

            return(w.tree.SelectedItem as ITypeInfo);
        }
Exemplo n.º 2
0
        internal static Resource RequestResource(PropertyEditorPanel owner, IResourceProvider provider, IEnumerable <object> targets, IPropertyInfo property, Resource currentValue)
        {
            Window hostWindow = Window.GetWindow(owner);

            var w = new ResourceSelectorWindow(owner.Resources.MergedDictionaries, provider, targets, property)
            {
                Owner = hostWindow,
                list  =
                {
                    SelectedItem = currentValue
                }
            };

            if (!w.ShowDialog() ?? false)
            {
                return(null);
            }

            return(w.list.SelectedItem as Resource);
        }