Remove test code for resizing until a better solution comes up
This commit is contained in:
+1
-47
@@ -66,7 +66,6 @@ namespace TheXamlGuy.NotificationFlyout.Uwp.UI.Controls
|
|||||||
|
|
||||||
internal event EventHandler PlacementPropertyChanged;
|
internal event EventHandler PlacementPropertyChanged;
|
||||||
|
|
||||||
|
|
||||||
public ImageSource IconSource
|
public ImageSource IconSource
|
||||||
{
|
{
|
||||||
get => (ImageSource)GetValue(IconSourceProperty);
|
get => (ImageSource)GetValue(IconSourceProperty);
|
||||||
@@ -199,7 +198,6 @@ namespace TheXamlGuy.NotificationFlyout.Uwp.UI.Controls
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TemplateSettings.SetValue(NotificationFlyoutTemplateSettings.HeightProperty, height);
|
TemplateSettings.SetValue(NotificationFlyoutTemplateSettings.HeightProperty, height);
|
||||||
TemplateSettings.SetValue(NotificationFlyoutTemplateSettings.WidthProperty, width);
|
TemplateSettings.SetValue(NotificationFlyoutTemplateSettings.WidthProperty, width);
|
||||||
|
|
||||||
@@ -225,28 +223,11 @@ namespace TheXamlGuy.NotificationFlyout.Uwp.UI.Controls
|
|||||||
ShowMode = FlyoutShowMode.Standard
|
ShowMode = FlyoutShowMode.Standard
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void UpdateTheme(bool isColorPrevalence) => VisualStateManager.GoToState(this, isColorPrevalence ? "ColorPrevalenceTheme" : "DefaultTheme", true);
|
internal void UpdateTheme(bool isColorPrevalence) => VisualStateManager.GoToState(this, isColorPrevalence ? "ColorPrevalenceTheme" : "DefaultTheme", true);
|
||||||
|
|
||||||
private Rectangle _topThumb;
|
|
||||||
private Grid _layoutRoot;
|
|
||||||
|
|
||||||
protected override void OnManipulationDelta(ManipulationDeltaRoutedEventArgs e)
|
|
||||||
{
|
|
||||||
base.OnManipulationDelta(e);
|
|
||||||
}
|
|
||||||
protected override void OnApplyTemplate()
|
protected override void OnApplyTemplate()
|
||||||
{
|
{
|
||||||
_layoutRoot = GetTemplateChild("LayoutRoot") as Grid;
|
|
||||||
_layoutRoot.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
|
|
||||||
|
|
||||||
_topThumb = GetTemplateChild("TopThumb") as Rectangle;
|
|
||||||
_topThumb.ManipulationMode = ManipulationModes.TranslateX | ManipulationModes.TranslateY;
|
|
||||||
|
|
||||||
_topThumb.ManipulationDelta += _topThumb_ManipulationDelta;
|
|
||||||
_topThumb.PointerPressed += _topThumb_PointerPressed;
|
|
||||||
_topThumb.PointerReleased += _topThumb_PointerReleased;
|
|
||||||
|
|
||||||
|
|
||||||
_container = GetTemplateChild("Container") as Border;
|
_container = GetTemplateChild("Container") as Border;
|
||||||
if (_container != null)
|
if (_container != null)
|
||||||
{
|
{
|
||||||
@@ -274,33 +255,6 @@ namespace TheXamlGuy.NotificationFlyout.Uwp.UI.Controls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void _topThumb_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
|
|
||||||
{
|
|
||||||
_layoutRoot.Height = _layoutRoot.ActualHeight;
|
|
||||||
_layoutRoot.Height -= e.Delta.Translation.Y ;
|
|
||||||
|
|
||||||
_popup.SetValue(Popup.VerticalOffsetProperty, _popup.VerticalOffset += e.Delta.Translation.Y);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void _topThumb_PointerReleased(object sender, PointerRoutedEventArgs e)
|
|
||||||
{
|
|
||||||
// XamlRoot.Content.ReleasePointerCapture(e.Pointer);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void _topThumb_PointerPressed(object sender, PointerRoutedEventArgs e)
|
|
||||||
{
|
|
||||||
//XamlRoot.Content.CapturePointer(e.Pointer);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void _topThumb_DragDelta(object sender, DragDeltaEventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
_layoutRoot.Height = _layoutRoot.ActualHeight;
|
|
||||||
_layoutRoot.Height -= e.VerticalChange;
|
|
||||||
|
|
||||||
_popup.SetValue(Popup.VerticalOffsetProperty, _popup.VerticalOffset += e.VerticalChange);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void OnIconPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args)
|
private static void OnIconPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args)
|
||||||
{
|
{
|
||||||
var sender = dependencyObject as NotificationFlyout;
|
var sender = dependencyObject as NotificationFlyout;
|
||||||
|
|||||||
-7
@@ -51,8 +51,6 @@
|
|||||||
</TransitionCollection>
|
</TransitionCollection>
|
||||||
</Border.Transitions>
|
</Border.Transitions>
|
||||||
<Grid>
|
<Grid>
|
||||||
|
|
||||||
|
|
||||||
<ScrollViewer
|
<ScrollViewer
|
||||||
x:Name="ScrollViewer"
|
x:Name="ScrollViewer"
|
||||||
AutomationProperties.AccessibilityView="Raw"
|
AutomationProperties.AccessibilityView="Raw"
|
||||||
@@ -70,11 +68,6 @@
|
|||||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||||
ContentTransitions="{TemplateBinding ContentTransitions}" />
|
ContentTransitions="{TemplateBinding ContentTransitions}" />
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
<Rectangle
|
|
||||||
x:Name="TopThumb"
|
|
||||||
Height="10"
|
|
||||||
VerticalAlignment="Top"
|
|
||||||
Fill="Red" />
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -2,22 +2,26 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Threading;
|
||||||
|
|
||||||
namespace TheXamlGuy.NotificationFlyout.Wpf.UI.Controls
|
namespace TheXamlGuy.NotificationFlyout.Wpf.UI.Controls
|
||||||
{
|
{
|
||||||
internal class TransparentXamlHost<TXamlContent> : XamlHost<TXamlContent> where TXamlContent : Windows.UI.Xaml.UIElement
|
internal class TransparentXamlHost<TXamlContent> : XamlHost<TXamlContent> where TXamlContent : Windows.UI.Xaml.UIElement
|
||||||
{
|
{
|
||||||
internal const double WindowSize = 10;
|
internal const double WindowSize = 1;
|
||||||
|
|
||||||
public TransparentXamlHost() => PrepareDefaultWindow();
|
public TransparentXamlHost() => PrepareDefaultWindow();
|
||||||
|
|
||||||
protected override void OnContentRendered(EventArgs args) => Hide();
|
|
||||||
|
|
||||||
protected override WindowsXamlHost OnPreparingXamlHost(WindowsXamlHost xamlHost)
|
protected override WindowsXamlHost OnPreparingXamlHost(WindowsXamlHost xamlHost)
|
||||||
{
|
{
|
||||||
xamlHost.Height = 0;
|
xamlHost.Height = 0;
|
||||||
xamlHost.Width = 0;
|
xamlHost.Width = 0;
|
||||||
|
|
||||||
|
Dispatcher.BeginInvoke(new Action(() =>
|
||||||
|
{
|
||||||
|
Hide();
|
||||||
|
}), DispatcherPriority.ContextIdle, null);
|
||||||
|
|
||||||
return base.OnPreparingXamlHost(xamlHost);
|
return base.OnPreparingXamlHost(xamlHost);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user