Remove test code for resizing until a better solution comes up

This commit is contained in:
Daniel Clark
2021-03-01 17:20:10 +00:00
parent 0a6b227fc6
commit ab7ea6415d
3 changed files with 8 additions and 57 deletions
@@ -66,7 +66,6 @@ namespace TheXamlGuy.NotificationFlyout.Uwp.UI.Controls
internal event EventHandler PlacementPropertyChanged;
public ImageSource IconSource
{
get => (ImageSource)GetValue(IconSourceProperty);
@@ -199,7 +198,6 @@ namespace TheXamlGuy.NotificationFlyout.Uwp.UI.Controls
break;
}
TemplateSettings.SetValue(NotificationFlyoutTemplateSettings.HeightProperty, height);
TemplateSettings.SetValue(NotificationFlyoutTemplateSettings.WidthProperty, width);
@@ -225,28 +223,11 @@ namespace TheXamlGuy.NotificationFlyout.Uwp.UI.Controls
ShowMode = FlyoutShowMode.Standard
});
}
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()
{
_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;
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)
{
var sender = dependencyObject as NotificationFlyout;
@@ -51,8 +51,6 @@
</TransitionCollection>
</Border.Transitions>
<Grid>
<ScrollViewer
x:Name="ScrollViewer"
AutomationProperties.AccessibilityView="Raw"
@@ -70,11 +68,6 @@
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}" />
</ScrollViewer>
<Rectangle
x:Name="TopThumb"
Height="10"
VerticalAlignment="Top"
Fill="Red" />
</Grid>
</Border>
</Grid>
@@ -2,22 +2,26 @@
using System;
using System.Windows;
using System.Windows.Media;
using System.Windows.Threading;
namespace TheXamlGuy.NotificationFlyout.Wpf.UI.Controls
{
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();
protected override void OnContentRendered(EventArgs args) => Hide();
protected override WindowsXamlHost OnPreparingXamlHost(WindowsXamlHost xamlHost)
{
xamlHost.Height = 0;
xamlHost.Width = 0;
Dispatcher.BeginInvoke(new Action(() =>
{
Hide();
}), DispatcherPriority.ContextIdle, null);
return base.OnPreparingXamlHost(xamlHost);
}