Skip to content

Commit

Permalink
Remove obsolete code
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinnara committed Sep 15, 2020
1 parent 89fe988 commit 8a56ee5
Show file tree
Hide file tree
Showing 17 changed files with 2 additions and 623 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>0.9.2-preview.200831.1</Version>
<Version>0.9.2-debug.200915.0</Version>
<Authors>Yimeng Wu</Authors>
<Product>ModernWPF UI Library</Product>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
16 changes: 0 additions & 16 deletions ModernWpf.Controls/CommandBar/AppBarButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,22 +278,6 @@ public string InputGestureText

#endregion

#region HasInputGestureText

[Obsolete]
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly DependencyProperty HasInputGestureTextProperty =
AppBarElementProperties.HasInputGestureTextProperty.AddOwner(typeof(AppBarButton));

[Obsolete]
[EditorBrowsable(EditorBrowsableState.Never)]
public bool HasInputGestureText
{
get => (bool)GetValue(HasInputGestureTextProperty);
}

#endregion

public override void OnApplyTemplate()
{
base.OnApplyTemplate();
Expand Down
46 changes: 0 additions & 46 deletions ModernWpf.Controls/CommandBar/AppBarToggleButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,35 +229,6 @@ void IAppBarElement.ApplyApplicationViewState()

#endregion

#region IsCheckedOrIndeterminate

private static readonly DependencyPropertyKey IsCheckedOrIndeterminatePropertyKey =
DependencyProperty.RegisterReadOnly(
nameof(IsCheckedOrIndeterminate),
typeof(bool),
typeof(AppBarToggleButton),
new PropertyMetadata(false));

[Obsolete]
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly DependencyProperty IsCheckedOrIndeterminateProperty =
IsCheckedOrIndeterminatePropertyKey.DependencyProperty;

[Obsolete]
[EditorBrowsable(EditorBrowsableState.Never)]
public bool IsCheckedOrIndeterminate
{
get => (bool)GetValue(IsCheckedOrIndeterminateProperty);
private set => SetValue(IsCheckedOrIndeterminatePropertyKey, value);
}

private void UpdateIsCheckedOrIndeterminate()
{
IsCheckedOrIndeterminate = IsChecked != false;
}

#endregion

#region InputGestureText

public static readonly DependencyProperty InputGestureTextProperty =
Expand All @@ -271,22 +242,6 @@ public string InputGestureText

#endregion

#region HasInputGestureText

[Obsolete]
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly DependencyProperty HasInputGestureTextProperty =
AppBarElementProperties.HasInputGestureTextProperty.AddOwner(typeof(AppBarToggleButton));

[Obsolete]
[EditorBrowsable(EditorBrowsableState.Never)]
public bool HasInputGestureText
{
get => (bool)GetValue(HasInputGestureTextProperty);
}

#endregion

public override void OnApplyTemplate()
{
base.OnApplyTemplate();
Expand Down Expand Up @@ -343,7 +298,6 @@ private static void OnCommandPropertyChanged(DependencyObject d, DependencyPrope
private static void OnIsCheckedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var button = (AppBarToggleButton)d;
button.UpdateIsCheckedOrIndeterminate();
button.UpdateCommonState();
}

Expand Down
29 changes: 0 additions & 29 deletions ModernWpf.Controls/ToggleSwitch/ToggleSwitch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,29 +224,6 @@ public DataTemplate OnContentTemplate

#endregion

#region IsPressed

private static readonly DependencyPropertyKey IsPressedPropertyKey =
DependencyProperty.RegisterReadOnly(
nameof(IsPressed),
typeof(bool),
typeof(ToggleSwitch),
null);

[Obsolete]
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly DependencyProperty IsPressedProperty = IsPressedPropertyKey.DependencyProperty;

[Obsolete]
[EditorBrowsable(EditorBrowsableState.Never)]
public bool IsPressed
{
get => (bool)GetValue(IsPressedProperty);
private set => SetValue(IsPressedPropertyKey, value);
}

#endregion

#region UseSystemFocusVisuals

public static readonly DependencyProperty UseSystemFocusVisualsProperty =
Expand Down Expand Up @@ -403,7 +380,6 @@ private static void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
private void OnSwitchThumbDragStarted(object sender, DragStartedEventArgs e)
{
e.Handled = true;
IsPressed = true;
_startTranslation = KnobTranslateTransform.X;
UpdateVisualStates(true);
KnobTranslateTransform.X = _startTranslation;
Expand All @@ -423,7 +399,6 @@ private void OnSwitchThumbDragDelta(object sender, DragDeltaEventArgs e)
private void OnSwitchThumbDragCompleted(object sender, DragCompletedEventArgs e)
{
e.Handled = true;
IsPressed = false;
bool click = false;
if (_wasDragged)
{
Expand Down Expand Up @@ -467,10 +442,6 @@ private void UpdateVisualStates(bool useTransitions)
{
stateName = VisualStates.StateDisabled;
}
else if (IsPressed)
{
stateName = VisualStates.StatePressed;
}
else if (IsMouseOver)
{
stateName = VisualStates.StateMouseOver;
Expand Down
56 changes: 0 additions & 56 deletions ModernWpf/ApplicationThemeResources.cs

This file was deleted.

187 changes: 0 additions & 187 deletions ModernWpf/Common/BindableSystemColors.cs

This file was deleted.

Loading

0 comments on commit 8a56ee5

Please sign in to comment.