-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WAF WPF Add Bind class which is a culture aware binding implementation
- Loading branch information
Showing
7 changed files
with
35 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 3 additions & 11 deletions
14
src/System.Waf/Samples/Localization/LocalizationSample/GlobalSuppressions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,4 @@ | ||
// This file is used by Code Analysis to maintain SuppressMessage | ||
// attributes that are applied to this project. | ||
// Project-level suppressions either have no target or are given | ||
// a specific target and scoped to a namespace, type, member, etc. | ||
// | ||
// To add a suppression to this file, right-click the message in the | ||
// Error List, point to "Suppress Message(s)", and click | ||
// "In Project Suppression File". | ||
// You do not need to add suppressions to this file manually. | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "LocalizationSample.Domain.Person.#Birthday")] | ||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "LocalizationSample.Domain.Person.#Name")] | ||
[assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "~P:LocalizationSample.Domain.Person.Birthday")] | ||
[assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "~P:LocalizationSample.Domain.Person.Name")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/System.Waf/System.Waf/System.Waf.Wpf/Presentation/Bind.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
|
||
namespace System.Waf.Presentation | ||
{ | ||
/// <summary>Culture aware binding, which connects the properties of binding target objects (typically, WPF elements) with any data source. It uses the <see cref="CultureInfo.CurrentCulture"/> for converting the values.</summary> | ||
public class Bind : Binding | ||
{ | ||
/// <summary>Initializes a new instance of the <see cref="Bind"/> class.</summary> | ||
public Bind() : base() | ||
{ | ||
ConverterCulture = CultureInfo.CurrentCulture; | ||
} | ||
|
||
/// <summary>Initializes a new instance of the <see cref="Bind"/> class.</summary> | ||
/// <param name="path">The initial <see cref="Binding.Path"/> for the binding.</param> | ||
public Bind(string path) : base(path) | ||
{ | ||
ConverterCulture = CultureInfo.CurrentCulture; | ||
} | ||
} | ||
} |