Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Louis <dominique@Dominiques-MacBook-Pro-2.local>2019-03-21 16:54:10 +0300
committerCartBlanche <savagesoftware@gmail.com>2019-06-26 21:17:31 +0300
commitbbe46e57cb1627d26ccc0e68dc9b2ed877b3d170 (patch)
treedb3205f282da1b63cf92c1a5cee3d7586743c525 /Xamarin.PropertyEditing
parent6be4f60fa2d4adf31893c75d8a8ef8ce879b6bd3 (diff)
[Mac] Make Binding Dialog Modal
[Mac] Ensure property button view is cleared
Diffstat (limited to 'Xamarin.PropertyEditing')
-rw-r--r--Xamarin.PropertyEditing/Properties/Resources.Designer.cs22
-rw-r--r--Xamarin.PropertyEditing/Properties/Resources.resx28
-rw-r--r--Xamarin.PropertyEditing/ViewModels/CreateBindingViewModel.cs30
3 files changed, 54 insertions, 26 deletions
diff --git a/Xamarin.PropertyEditing/Properties/Resources.Designer.cs b/Xamarin.PropertyEditing/Properties/Resources.Designer.cs
index f617aab..6f5177b 100644
--- a/Xamarin.PropertyEditing/Properties/Resources.Designer.cs
+++ b/Xamarin.PropertyEditing/Properties/Resources.Designer.cs
@@ -1169,15 +1169,9 @@ namespace Xamarin.PropertyEditing.Properties {
}
}
- public static string ShowSettings {
+ public static string OtherSettings {
get {
- return ResourceManager.GetString("ShowSettings", resourceCulture);
- }
- }
-
- public static string HideSettings {
- get {
- return ResourceManager.GetString("HideSettings", resourceCulture);
+ return ResourceManager.GetString("OtherSettings", resourceCulture);
}
}
@@ -1198,5 +1192,17 @@ namespace Xamarin.PropertyEditing.Properties {
return ResourceManager.GetString("DoneTitle", resourceCulture);
}
}
+
+ public static string TypeNotSupported {
+ get {
+ return ResourceManager.GetString("TypeNotSupported", resourceCulture);
+ }
+ }
+
+ public static string ResourceNotSupported {
+ get {
+ return ResourceManager.GetString("ResourceNotSupported", resourceCulture);
+ }
+ }
}
}
diff --git a/Xamarin.PropertyEditing/Properties/Resources.resx b/Xamarin.PropertyEditing/Properties/Resources.resx
index 0e4966b..75b46a3 100644
--- a/Xamarin.PropertyEditing/Properties/Resources.resx
+++ b/Xamarin.PropertyEditing/Properties/Resources.resx
@@ -327,7 +327,7 @@
<value>OK</value>
</data>
<data name="ShowAllAssemblies" xml:space="preserve">
- <value>Show all assemblies</value>
+ <value>Show All Assemblies</value>
</data>
<data name="SearchProperties" xml:space="preserve">
<value>Search properties</value>
@@ -510,29 +510,29 @@
<value>Name</value>
</data>
<data name="ResourceDictionary" xml:space="preserve">
- <value>Resource dictionary</value>
+ <value>Resource Dictionary</value>
</data>
<data name="CreateDataBindingMenuItem" xml:space="preserve">
<value>Create New Binding…</value>
</data>
<data name="AddValueConverterEllipsis" xml:space="preserve">
- <value>Add value converter…</value>
+ <value>Add Value Converter…</value>
</data>
<data name="AddValueConverterTitle" xml:space="preserve">
<value>Add Value Converter</value>
</data>
<data name="NoValueConverter" xml:space="preserve">
- <value>No value converter</value>
+ <value>No Value Converter</value>
</data>
<data name="ValueConverterName" xml:space="preserve">
- <value>Value converter name</value>
+ <value>Value Converter Name</value>
</data>
<data name="CreateDataBindingTitle" xml:space="preserve">
<value>Create Data Binding for {0}</value>
<comment>Create Data Binding for Object.Property</comment>
</data>
<data name="BindingType" xml:space="preserve">
- <value>Binding type</value>
+ <value>Binding Type</value>
</data>
<data name="Path" xml:space="preserve">
<value>Path</value>
@@ -756,13 +756,9 @@
<value>Create Binding</value>
<comment>Create Binding for Object.Property</comment>
</data>
- <data name="ShowSettings" xml:space="preserve">
- <value>Show Settings</value>
- <comment>Show Settings for Binding to Object.Property</comment>
- </data>
- <data name="HideSettings" xml:space="preserve">
- <value>Hide Settings</value>
- <comment>Hide Settings for Binding to Object.Property</comment>
+ <data name="OtherSettings" xml:space="preserve">
+ <value>Other Settings</value>
+ <comment>Toggle the Other Settings Panel for Binding to Object.Property</comment>
</data>
<data name="Converter" xml:space="preserve">
<value>Converter</value>
@@ -774,4 +770,10 @@
<data name="DoneTitle" xml:space="preserve">
<value>Done</value>
</data>
+ <data name="TypeNotSupported" xml:space="preserve">
+ <value>Type Not Supported</value>
+ </data>
+ <data name="ResourceNotSupported" xml:space="preserve">
+ <value>Resource Not Supported</value>
+ </data>
</root>
diff --git a/Xamarin.PropertyEditing/ViewModels/CreateBindingViewModel.cs b/Xamarin.PropertyEditing/ViewModels/CreateBindingViewModel.cs
index 6c1dff4..959e425 100644
--- a/Xamarin.PropertyEditing/ViewModels/CreateBindingViewModel.cs
+++ b/Xamarin.PropertyEditing/ViewModels/CreateBindingViewModel.cs
@@ -2,9 +2,9 @@ using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
-using System.Text;
using System.Threading;
using System.Threading.Tasks;
+using System.Windows.Input;
using Xamarin.PropertyEditing.Properties;
namespace Xamarin.PropertyEditing.ViewModels
@@ -34,7 +34,7 @@ namespace Xamarin.PropertyEditing.ViewModels
internal class CreateBindingViewModel
: PropertiesViewModel, IProvidePath
{
- public CreateBindingViewModel (TargetPlatform platform, IObjectEditor targetEditor, IPropertyInfo property, PropertyVariation variations = null)
+ public CreateBindingViewModel (TargetPlatform platform, IObjectEditor targetEditor, IPropertyInfo property, PropertyVariation variations = null, bool includeAddValueConverter = true)
: base (platform)
{
if (platform == null)
@@ -51,6 +51,7 @@ namespace Xamarin.PropertyEditing.ViewModels
this.property = property;
this.provider = platform.BindingProvider;
this.variations = variations;
+ IncludeAddValueConverter = includeAddValueConverter;
PropertyDisplay = String.Format (Resources.CreateDataBindingTitle, $"[{this.targetEditor.TargetType.Name}].{property.Name}");
RequestNamedDisplay ();
@@ -58,7 +59,9 @@ namespace Xamarin.PropertyEditing.ViewModels
BindingSources = new AsyncValue<IReadOnlyList<BindingSource>> (
platform.BindingProvider.GetBindingSourcesAsync (targetEditor.Target, property));
- RequestBindingObject();
+ this.requestAddValueConverterCommand = new RelayCommand (OnRequestAddValueConverter, CanRequestAddValueConverter);
+
+ RequestBindingObject ();
}
private async void RequestBindingObject ()
@@ -235,6 +238,8 @@ namespace Xamarin.PropertyEditing.ViewModels
OnPropertyChanged();
UpdateShowProperties();
RequestUpdateSources();
+
+ ((RelayCommand)RequestAddValueConverterCommand)?.ChangeCanExecute ();
}
}
@@ -452,7 +457,7 @@ namespace Xamarin.PropertyEditing.ViewModels
}
private static readonly Resource NoValueConverter = new Resource (Resources.NoValueConverter);
- internal static readonly Resource AddValueConverter = new Resource ("<" + Resources.AddValueConverterEllipsis + ">");
+ private static readonly Resource AddValueConverter = new Resource ("<" + Resources.AddValueConverterEllipsis + ">");
private readonly PropertyVariation variations;
private readonly IObjectEditor targetEditor;
@@ -483,6 +488,8 @@ namespace Xamarin.PropertyEditing.ViewModels
set { GetKnownPropertyViewModel<object> (PropertyBinding.SourceParameterProperty).Value = value; }
}
+ public bool IncludeAddValueConverter { get; private set; }
+
private void UpdateShowProperties ()
{
OnPropertyChanged (nameof (ShowResourceSelector));
@@ -499,7 +506,7 @@ namespace Xamarin.PropertyEditing.ViewModels
this.valueConverters.AddRange (converters);
// Don't add the AddValueConverter resource if we are on Mac
- if (Environment.OSVersion.Platform != PlatformID.Unix) {
+ if (IncludeAddValueConverter) {
this.valueConverters.Add (AddValueConverter);
}
@@ -678,5 +685,18 @@ namespace Xamarin.PropertyEditing.ViewModels
throw new ArgumentException();
}
}
+
+ private readonly RelayCommand requestAddValueConverterCommand;
+ public ICommand RequestAddValueConverterCommand => this.requestAddValueConverterCommand;
+
+ private bool CanRequestAddValueConverter ()
+ {
+ return TargetPlatform.BindingProvider != null;
+ }
+
+ private void OnRequestAddValueConverter ()
+ {
+ SelectedValueConverter = AddValueConverter;
+ }
}
}