Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinnara committed May 14, 2020
1 parent 36a4b01 commit 2e24f4a
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 27 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.0-preview.200505.0</Version>
<Version>0.9.0-preview.200515.2</Version>
<Authors>Yimeng Wu</Authors>
<Product>ModernWPF UI Library</Product>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
namespace ModernWpf.MahApps.Controls
using System;

namespace ModernWpf.MahApps.Controls
{
/// <summary>
/// Provides event data for the HamburgerMenuEx.BackRequested event.
/// </summary>
[Obsolete]
public sealed class HamburgerMenuBackRequestedEventArgs
{
internal HamburgerMenuBackRequestedEventArgs()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using MahApps.Metro.Controls;
using System;

namespace ModernWpf.MahApps.Controls
{
/// <summary>
/// Provides event data for the HamburgerMenuEx.DisplayModeChanged event.
/// </summary>
[Obsolete]
public sealed class HamburgerMenuDisplayModeChangedEventArgs
{
internal HamburgerMenuDisplayModeChangedEventArgs(SplitViewDisplayMode displayMode)
Expand Down
1 change: 1 addition & 0 deletions ModernWpf.MahApps/HamburgerMenu/HamburgerMenuEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace ModernWpf.MahApps.Controls
/// Represents a container that enables navigation of app content. It has a header,
/// a view for the main content, and a menu pane for navigation commands.
/// </summary>
[Obsolete]
[TemplatePart(Name = c_navViewBackButton, Type = typeof(Button))]
public class HamburgerMenuEx : HamburgerMenu
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
namespace ModernWpf.MahApps.Controls
using System;

namespace ModernWpf.MahApps.Controls
{
/// <summary>
/// Provides data for the HamburgerMenuEx.SelectionChanged event.
/// </summary>
[Obsolete]
public sealed class HamburgerMenuSelectionChangedEventArgs
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

namespace ModernWpf.MahApps.Controls
{
[Obsolete]
public class HamburgerMenuTitleBarPaddingConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
Expand Down
2 changes: 1 addition & 1 deletion ModernWpf.MahApps/ModernWpf.MahApps.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MahApps.Metro" Version="2.0.0-alpha0748" />
<PackageReference Include="MahApps.Metro" Version="2.0.0-alpha0821" />
</ItemGroup>

<ItemGroup>
Expand Down
39 changes: 21 additions & 18 deletions ModernWpf.MahApps/TimePicker/SimpleTimePicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ namespace ModernWpf.MahApps.Controls
[ContentProperty(nameof(Header))]
public class SimpleTimePicker : TimePicker
{
private const string ElementPopup = "PART_Popup";
private const string ElementAmPmSwitcher = "PART_AmPmSwitcher";
private const string ElementHourPicker = "PART_HourPicker";
private const string ElementMinutePicker = "PART_MinutePicker";
private const string ElementSecondPicker = "PART_SecondPicker";

private Popup _popup;

private DateTimeComponentSelector _ampmSwitcher;
private DateTimeComponentSelector _hourInput;
private DateTimeComponentSelector _minuteInput;
Expand All @@ -38,6 +41,7 @@ static SimpleTimePicker()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(SimpleTimePicker), new FrameworkPropertyMetadata(typeof(SimpleTimePicker)));

SelectedDateTimeProperty.OverrideMetadata(typeof(SimpleTimePicker), new FrameworkPropertyMetadata(OnSelectedDateTimeChanged));
IsDropDownOpenProperty.OverrideMetadata(typeof(SimpleTimePicker), new FrameworkPropertyMetadata(OnIsDropDownOpenChanged));
}

Expand All @@ -53,8 +57,8 @@ public SimpleTimePicker()
/// <summary>
/// Identifies the UseSystemFocusVisuals dependency property.
/// </summary>
public static readonly DependencyProperty UseSystemFocusVisualsProperty =
FocusVisualHelper.UseSystemFocusVisualsProperty.AddOwner(typeof(SimpleTimePicker));
public static readonly DependencyProperty UseSystemFocusVisualsProperty =
FocusVisualHelper.UseSystemFocusVisualsProperty.AddOwner(typeof(SimpleTimePicker));

/// <summary>
/// Gets or sets a value that indicates whether the control uses focus visuals that
Expand Down Expand Up @@ -206,6 +210,9 @@ private IEnumerable<DateTimeComponentSelector> Selectors
/// </summary>
public override void OnApplyTemplate()
{
UnSubscribeEvents();

_popup = GetTemplateChild(ElementPopup) as Popup;
_hourInput = GetTemplateChild(ElementHourPicker) as DateTimeComponentSelector;
_minuteInput = GetTemplateChild(ElementMinutePicker) as DateTimeComponentSelector;
_secondInput = GetTemplateChild(ElementSecondPicker) as DateTimeComponentSelector;
Expand All @@ -219,6 +226,7 @@ public override void OnApplyTemplate()

base.OnApplyTemplate();

SubscribeEvents();
UpdateTextBlocks();
}

Expand All @@ -230,13 +238,11 @@ protected override void OnIsKeyboardFocusWithinChanged(DependencyPropertyChanged
}
}

protected override void SubscribeEvents()
private void SubscribeEvents()
{
base.SubscribeEvents();

if (Popup != null)
if (_popup != null)
{
Popup.Opened += OnPopupOpened;
_popup.Opened += OnPopupOpened;
}

if (_acceptButton != null)
Expand All @@ -250,13 +256,11 @@ protected override void SubscribeEvents()
}
}

protected override void UnSubscribeEvents()
private void UnSubscribeEvents()
{
base.UnSubscribeEvents();

if (Popup != null)
if (_popup != null)
{
Popup.Opened -= OnPopupOpened;
_popup.Opened -= OnPopupOpened;
}

if (_acceptButton != null)
Expand Down Expand Up @@ -288,11 +292,10 @@ protected override void ApplyCulture()
}
}

protected override void OnSelectedTimeChanged(TimePickerBaseSelectionChangedEventArgs<DateTime?> e)
private static void OnSelectedDateTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
base.OnSelectedTimeChanged(e);

UpdateTextBlocks();
var timePicker = (SimpleTimePicker)d;
timePicker.UpdateTextBlocks();
}

private static void OnIsDropDownOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
Expand Down Expand Up @@ -389,9 +392,9 @@ private void OnPopupOpened(object sender, EventArgs e)
private void ClosePopup()
{
SetCurrentValue(IsDropDownOpenProperty, false);
if (Popup != null && Popup.IsOpen)
if (_popup != null && _popup.IsOpen)
{
Popup.IsOpen = false;
_popup.IsOpen = false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;

namespace MahAppsSample.ControlPages
{
Expand All @@ -13,7 +12,7 @@ public SimpleTimePickerPage()
InitializeComponent();
}

private void TimePicker_SelectedDateTimeChanged(object sender, TimePickerBaseSelectionChangedEventArgs<DateTime?> e)
private void TimePicker_SelectedDateTimeChanged(object sender, RoutedPropertyChangedEventArgs<DateTime?> e)
{
Debug.WriteLine(e.NewValue?.ToShortTimeString() ?? "null");
}
Expand Down
2 changes: 1 addition & 1 deletion samples/MahAppsSample/MahAppsSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MahApps.Metro" Version="2.0.0-alpha0748" />
<PackageReference Include="MahApps.Metro" Version="2.0.0-alpha0821" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/ModernWpf.Test/ModernWpf.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
<PackageReference Include="coverlet.collector" Version="1.2.1">
Expand Down
2 changes: 1 addition & 1 deletion test/ModernWpfTestApp/ModernWpfTestApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
<PackageReference Include="System.Runtime.WindowsRuntime" Version="4.7.0" />
Expand Down

0 comments on commit 2e24f4a

Please sign in to comment.