mirror of
https://github.com/holgerb83/ModernWpfPlayground.git
synced 2025-04-19 23:03:49 +02:00
removed warnings
This commit is contained in:
parent
ca000aac74
commit
d130364643
@ -21,6 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||||||
SOFTWARE. */
|
SOFTWARE. */
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
// ReSharper disable InheritdocConsiderUsage
|
// ReSharper disable InheritdocConsiderUsage
|
||||||
|
|
||||||
#pragma warning disable 1591
|
#pragma warning disable 1591
|
||||||
@ -31,7 +32,7 @@ using System;
|
|||||||
// ReSharper disable MemberCanBeProtected.Global
|
// ReSharper disable MemberCanBeProtected.Global
|
||||||
// ReSharper disable InconsistentNaming
|
// ReSharper disable InconsistentNaming
|
||||||
|
|
||||||
namespace ModernWpfPlayground.Annotations
|
namespace ModernWpfPlayground
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates that the value of the marked element could be <c>null</c> sometimes,
|
/// Indicates that the value of the marked element could be <c>null</c> sometimes,
|
||||||
|
@ -7,7 +7,6 @@ using System.Runtime.CompilerServices;
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using ModernWpfPlayground.Annotations;
|
|
||||||
|
|
||||||
namespace ModernWpfPlayground
|
namespace ModernWpfPlayground
|
||||||
{
|
{
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
x:Class="ModernWpfPlayground.MainWindow"
|
x:Class="ModernWpfPlayground.MainWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:controls="clr-namespace:LsBricks.Controls"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="clr-namespace:ModernWpfPlayground"
|
xmlns:local="clr-namespace:ModernWpfPlayground"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||||
|
xmlns:propertyPresenter2="clr-namespace:ModernWpfPlayground.PropertyPresenter2"
|
||||||
x:Name="Window"
|
x:Name="Window"
|
||||||
Title="TaBEA 3.0.0"
|
Title="TaBEA 3.0.0"
|
||||||
Width="1200"
|
Width="1200"
|
||||||
@ -210,17 +210,17 @@
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="General" IsSelected="True">
|
<TabItem Header="General" IsSelected="True">
|
||||||
<ui:SimpleStackPanel Margin="5" Spacing="10">
|
<ui:SimpleStackPanel Margin="5" Spacing="10">
|
||||||
<controls:PropertyPresenter2
|
<propertyPresenter2:PropertyPresenter2
|
||||||
Command="{Binding ShowDialogCommand}"
|
Command="{Binding ShowDialogCommand}"
|
||||||
Label="Hello"
|
Label="Hello"
|
||||||
Symbol="x³"
|
Symbol="x³"
|
||||||
Value="{Binding WelcomeMessage}" />
|
Value="{Binding WelcomeMessage}" />
|
||||||
<controls:PropertyPresenter2
|
<propertyPresenter2:PropertyPresenter2
|
||||||
Label="Hallo"
|
Label="Hallo"
|
||||||
Symbol="x²"
|
Symbol="x²"
|
||||||
Value="{Binding ValidationTest}" />
|
Value="{Binding ValidationTest}" />
|
||||||
<controls:PropertyPresenter2 Label="Hello" Value="{Binding BooleanValue}" />
|
<propertyPresenter2:PropertyPresenter2 Label="Hello" Value="{Binding BooleanValue}" />
|
||||||
<controls:PropertyPresenter2 Label="Hello">
|
<propertyPresenter2:PropertyPresenter2 Label="Hello">
|
||||||
<Slider
|
<Slider
|
||||||
AutoToolTipPlacement="TopLeft"
|
AutoToolTipPlacement="TopLeft"
|
||||||
Interval="1"
|
Interval="1"
|
||||||
@ -230,13 +230,13 @@
|
|||||||
TickFrequency="10"
|
TickFrequency="10"
|
||||||
TickPlacement="BottomRight"
|
TickPlacement="BottomRight"
|
||||||
Value="{Binding SliderTest}" />
|
Value="{Binding SliderTest}" />
|
||||||
</controls:PropertyPresenter2>
|
</propertyPresenter2:PropertyPresenter2>
|
||||||
<ui:ProgressRing
|
<ui:ProgressRing
|
||||||
Width="{Binding SliderTest}"
|
Width="{Binding SliderTest}"
|
||||||
Height="{Binding SliderTest}"
|
Height="{Binding SliderTest}"
|
||||||
IsActive="{Binding BooleanValue}"
|
IsActive="{Binding BooleanValue}"
|
||||||
Visibility="{Binding VisibilityEnumTest}" />
|
Visibility="{Binding VisibilityEnumTest}" />
|
||||||
<controls:PropertyPresenter2 Label="Visi" Value="{Binding VisibilityEnumTest}" />
|
<propertyPresenter2:PropertyPresenter2 Label="Visi" Value="{Binding VisibilityEnumTest}" />
|
||||||
</ui:SimpleStackPanel>
|
</ui:SimpleStackPanel>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
|
@ -1,24 +1,9 @@
|
|||||||
using System;
|
namespace ModernWpfPlayground
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace ModernWpfPlayground
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for MainWindow.xaml
|
/// Interaction logic for MainWindow.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class MainWindow : Window
|
public partial class MainWindow
|
||||||
{
|
{
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
|
@ -5,7 +5,7 @@ using System.Globalization;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
|
|
||||||
namespace LsBricks.Controls
|
namespace ModernWpfPlayground.PropertyPresenter2
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts enums to a List with KeyValuePairs.
|
/// Converts enums to a List with KeyValuePairs.
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Markup;
|
using System.Windows.Markup;
|
||||||
|
|
||||||
namespace LsBricks.Controls
|
namespace ModernWpfPlayground.PropertyPresenter2
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for <see cref="MagicSymbolControl"/>
|
/// Interaction logic for <see cref="MagicSymbolControl"/>
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using LsBricks.ElementMVVM.Types;
|
using System;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@ -9,7 +8,7 @@ using System.Windows.Data;
|
|||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace LsBricks.Controls
|
namespace ModernWpfPlayground.PropertyPresenter2
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Magically converts a text to
|
/// Magically converts a text to
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
namespace LsBricks.Controls
|
namespace ModernWpfPlayground.PropertyPresenter2
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Selects the right template on base of value-type.
|
/// Selects the right template on base of value-type.
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<ContentControl
|
<ContentControl
|
||||||
x:Class="LsBricks.Controls.PropertyPresenter2"
|
x:Class="ModernWpfPlayground.PropertyPresenter2.PropertyPresenter2"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:controls="clr-namespace:LsBricks.Controls"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:propertyPresenter2="clr-namespace:ModernWpfPlayground.PropertyPresenter2"
|
||||||
x:Name="LayoutRoot"
|
x:Name="LayoutRoot"
|
||||||
d:DesignHeight="300"
|
d:DesignHeight="300"
|
||||||
d:DesignWidth="300"
|
d:DesignWidth="300"
|
||||||
@ -16,13 +16,13 @@
|
|||||||
<ContentControl.Resources>
|
<ContentControl.Resources>
|
||||||
<DataTemplate x:Key="DefaultDataTemplate">
|
<DataTemplate x:Key="DefaultDataTemplate">
|
||||||
<Grid>
|
<Grid>
|
||||||
<controls:TextBoxEx
|
<propertyPresenter2:TextBoxEx
|
||||||
x:Name="InputTextBox"
|
x:Name="InputTextBox"
|
||||||
Text="{Binding Value, ElementName=LayoutRoot}"
|
Text="{Binding Value, ElementName=LayoutRoot}"
|
||||||
Validation.ErrorTemplate="{DynamicResource ValidationErrorTemplate}"
|
Validation.ErrorTemplate="{DynamicResource ValidationErrorTemplate}"
|
||||||
Validation.ValidationAdornerSiteFor="{Binding ElementName=LayoutRoot}">
|
Validation.ValidationAdornerSiteFor="{Binding ElementName=LayoutRoot}">
|
||||||
<TextBox.Style>
|
<TextBox.Style>
|
||||||
<Style BasedOn="{StaticResource {x:Type TextBox}}" TargetType="{x:Type controls:TextBoxEx}">
|
<Style BasedOn="{StaticResource {x:Type TextBox}}" TargetType="{x:Type propertyPresenter2:TextBoxEx}">
|
||||||
<Setter Property="IsReadOnly" Value="True" />
|
<Setter Property="IsReadOnly" Value="True" />
|
||||||
<Setter Property="UpdateBindingOnEnter" Value="False" />
|
<Setter Property="UpdateBindingOnEnter" Value="False" />
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
@ -38,7 +38,7 @@
|
|||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
</TextBox.Style>
|
</TextBox.Style>
|
||||||
</controls:TextBoxEx>
|
</propertyPresenter2:TextBoxEx>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="6,0,0,0"
|
Margin="6,0,0,0"
|
||||||
Padding="2,2,2,2"
|
Padding="2,2,2,2"
|
||||||
@ -86,7 +86,7 @@
|
|||||||
</CheckBox.Style>
|
</CheckBox.Style>
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
<controls:EnumToKeyValueListConverter x:Key="EnumToKeyValuePairConverter" />
|
<propertyPresenter2:EnumToKeyValueListConverter x:Key="EnumToKeyValuePairConverter" />
|
||||||
<DataTemplate x:Key="EnumComboBoxDataTemplate">
|
<DataTemplate x:Key="EnumComboBoxDataTemplate">
|
||||||
<ComboBox
|
<ComboBox
|
||||||
DisplayMemberPath="Key"
|
DisplayMemberPath="Key"
|
||||||
@ -112,7 +112,7 @@
|
|||||||
</ComboBox.Style>
|
</ComboBox.Style>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
<controls:PropertyDataTemplateSelector
|
<propertyPresenter2:PropertyDataTemplateSelector
|
||||||
x:Key="DataTemplateSelector"
|
x:Key="DataTemplateSelector"
|
||||||
BooleanDataTemplate="{StaticResource BooleanDataTemplate}"
|
BooleanDataTemplate="{StaticResource BooleanDataTemplate}"
|
||||||
DefaultDataTemplate="{StaticResource DefaultDataTemplate}"
|
DefaultDataTemplate="{StaticResource DefaultDataTemplate}"
|
||||||
@ -152,7 +152,7 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Focusable="False"
|
Focusable="False"
|
||||||
Text="{Binding Label, ElementName=LayoutRoot}" />
|
Text="{Binding Label, ElementName=LayoutRoot}" />
|
||||||
<controls:MagicSymbolControl
|
<propertyPresenter2:MagicSymbolControl
|
||||||
x:Name="PartSymbol"
|
x:Name="PartSymbol"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Margin="5,0"
|
Margin="5,0"
|
||||||
|
@ -3,7 +3,7 @@ using System.Windows.Controls;
|
|||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Markup;
|
using System.Windows.Markup;
|
||||||
|
|
||||||
namespace LsBricks.Controls
|
namespace ModernWpfPlayground.PropertyPresenter2
|
||||||
{
|
{
|
||||||
/// <inheritdoc cref="ContentControl" />
|
/// <inheritdoc cref="ContentControl" />
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace LsBricks.Controls
|
namespace ModernWpfPlayground.PropertyPresenter2
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -38,7 +38,7 @@ namespace LsBricks.Controls
|
|||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="T:LsBricks.Controls.TextBoxEx" /> class.
|
/// Initializes a new instance of the <see cref="T:ModernWpfPlayground.PropertyPresenter2.TextBoxEx" /> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public TextBoxEx()
|
public TextBoxEx()
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace LsBricks.ElementMVVM.Types
|
namespace ModernWpfPlayground.PropertyPresenter2
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A component of the symbol
|
/// A component of the symbol
|
||||||
|
@ -11,7 +11,7 @@ using Brushes = System.Windows.Media.Brushes;
|
|||||||
using FontFamily = System.Windows.Media.FontFamily;
|
using FontFamily = System.Windows.Media.FontFamily;
|
||||||
using Point = System.Windows.Point;
|
using Point = System.Windows.Point;
|
||||||
|
|
||||||
namespace LsBricks.Controls
|
namespace ModernWpfPlayground.PropertyPresenter2
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Makes an Bitmap from every Imageformat.
|
/// Makes an Bitmap from every Imageformat.
|
||||||
@ -97,28 +97,4 @@ namespace LsBricks.Controls
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => Binding.DoNothing;
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => Binding.DoNothing;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// negate double converter
|
|
||||||
/// </summary>
|
|
||||||
[ValueConversion(typeof(double), typeof(double))]
|
|
||||||
public class NegateDoubleConverter : IValueConverter
|
|
||||||
{
|
|
||||||
/// <summary>Converts a value. </summary>
|
|
||||||
/// <returns>A converted value. If the method returns null, the valid null value is used.</returns>
|
|
||||||
/// <param name="value">The value produced by the binding source.</param>
|
|
||||||
/// <param name="targetType">The type of the binding target property.</param>
|
|
||||||
/// <param name="parameter">The converter parameter to use.</param>
|
|
||||||
/// <param name="culture">The culture to use in the converter.</param>
|
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) =>
|
|
||||||
value is double d ? -d : throw new ArgumentException(nameof(value) + " is not a doubles");
|
|
||||||
|
|
||||||
/// <summary>Converts a value. </summary>
|
|
||||||
/// <returns>A converted value. If the method returns null, the valid null value is used.</returns>
|
|
||||||
/// <param name="value">The value that is produced by the binding target.</param>
|
|
||||||
/// <param name="targetType">The type to convert to.</param>
|
|
||||||
/// <param name="parameter">The converter parameter to use.</param>
|
|
||||||
/// <param name="culture">The culture to use in the converter.</param>
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => Binding.DoNothing;
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user