Pandetthe
Pandetthe
CC#
Created by Pandetthe on 3/26/2024 in #help
WFP InkCanvas hit test
I have observed that It's happening only with inkcanvas that size was changed dynamically in code
10 replies
CC#
Created by Pandetthe on 3/26/2024 in #help
WFP InkCanvas hit test
And every hittest and raiseevents hits scrollviewer
10 replies
CC#
Created by Pandetthe on 3/26/2024 in #help
WFP InkCanvas hit test
And it's the same problem for routed events, that they don't reach inkcanvas every 4 raise
10 replies
CC#
Created by Pandetthe on 3/26/2024 in #help
WFP InkCanvas hit test
Every 4 hittest or inputthittest misses inkcanvas
10 replies
CC#
Created by Pandetthe on 3/26/2024 in #help
WFP InkCanvas hit test
Page is looking like this
<ScrollViewer x:Name="ContainerScrollViewer" CanContentScroll="False" VerticalScrollBarVisibility="Auto>
<StackPanel x:Name="Container" HorizontalAlignment="Stretch" VerticalAliggnment="Stretch" />
</ScrollViewer>
<ScrollViewer x:Name="ContainerScrollViewer" CanContentScroll="False" VerticalScrollBarVisibility="Auto>
<StackPanel x:Name="Container" HorizontalAlignment="Stretch" VerticalAliggnment="Stretch" />
</ScrollViewer>
10 replies
CC#
Created by Pandetthe on 3/26/2024 in #help
WFP InkCanvas hit test
Grid pageControl = new()
{
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Top,
Background = new ImageBrush(page.PageImage)
{
Stretch = Stretch.Uniform,
},
Width = page.PageImage.Width,
Height = page.PageImage.Height - 1,
Margin = i == pages.Count - 1 ? new(0) : new(0, 0, 0, 10)
};
pageControl.Children.Add(new InkCanvas());
Container.Children.Add(pageControl);
Grid pageControl = new()
{
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Top,
Background = new ImageBrush(page.PageImage)
{
Stretch = Stretch.Uniform,
},
Width = page.PageImage.Width,
Height = page.PageImage.Height - 1,
Margin = i == pages.Count - 1 ? new(0) : new(0, 0, 0, 10)
};
pageControl.Children.Add(new InkCanvas());
Container.Children.Add(pageControl);
10 replies
CC#
Created by Pandetthe on 3/26/2024 in #help
WFP InkCanvas hit test
But when we add ink canvas like this, its not working properly
10 replies
CC#
Created by Pandetthe on 3/26/2024 in #help
WFP InkCanvas hit test
Container.Children.Add(new InkCanvas());
Grid pageControl = new()
{
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Top,
Background = new ImageBrush(page.PageImage)
{
Stretch = Stretch.Uniform,
},
Width = page.PageImage.Width,
Height = page.PageImage.Height - 1,
Margin = i == pages.Count - 1 ? new(0) : new(0, 0, 0, 10)
};
Container.Children.Add(pageControl);
Container.Children.Add(new InkCanvas());
Grid pageControl = new()
{
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Top,
Background = new ImageBrush(page.PageImage)
{
Stretch = Stretch.Uniform,
},
Width = page.PageImage.Width,
Height = page.PageImage.Height - 1,
Margin = i == pages.Count - 1 ? new(0) : new(0, 0, 0, 10)
};
Container.Children.Add(pageControl);
10 replies
CC#
Created by Pandetthe on 3/26/2024 in #help
WFP InkCanvas hit test
Everything works fine when InkCanvas is added to the page like this
10 replies
CC#
Created by Pandetthe on 3/25/2024 in #help
WPF inkcanvas input simulation
Before anyone ask, I am implementing Wintab api and in this project using windows ink and implemented with it in WPF stylus is not ideal
2 replies
CC#
Created by Pandetthe on 3/20/2024 in #help
Find popup window in Wpf
PresentationSource.CurrentSources.OfType<HwndSource>()
.Select(h => h.RootVisual)
.OfType<FrameworkElement>()
.Select(f => f.Parent)
.OfType<Popup>()
.Where(popup => popup.IsOpen);
PresentationSource.CurrentSources.OfType<HwndSource>()
.Select(h => h.RootVisual)
.OfType<FrameworkElement>()
.Select(f => f.Parent)
.OfType<Popup>()
.Where(popup => popup.IsOpen);
6 replies
CC#
Created by Pandetthe on 3/20/2024 in #help
Find popup window in Wpf
I found solution
6 replies
CC#
Created by Pandetthe on 3/20/2024 in #help
Find popup window in Wpf
It's not working for popups used for example in combobox
6 replies
CC#
Created by Pandetthe on 3/20/2024 in #help
Find popup window in Wpf
I found that in Uwp exists VisualTreeHelper.GetOpenPopups(), but is there any option to use it in Wpf?
6 replies
CC#
Created by Pandetthe on 3/3/2024 in #help
✅ Wndproc is not receiving any messages when window is not focused
Thanks, I found another solution based on wintab api
22 replies
CC#
Created by Pandetthe on 3/5/2024 in #help
Wpf custom button template proble
<DataTrigger Binding="{Binding Path=IsPenOver}" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
</DataTrigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</UserControl.Resources>
<Grid>
<Button Template="{DynamicResource ButtonTemplate}" x:Name="ButtonControl" Content="{Binding Content, ElementName=ExtendedButton}"/>
</Grid>
</UserControl>
<DataTrigger Binding="{Binding Path=IsPenOver}" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
</DataTrigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</UserControl.Resources>
<Grid>
<Button Template="{DynamicResource ButtonTemplate}" x:Name="ButtonControl" Content="{Binding Content, ElementName=ExtendedButton}"/>
</Grid>
</UserControl>
3 replies
CC#
Created by Pandetthe on 3/5/2024 in #help
Wpf custom button template proble
<Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Button.IsDefaulted" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
</Trigger>
<Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Button.IsDefaulted" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
</Trigger>
3 replies
CC#
Created by Pandetthe on 3/3/2024 in #help
✅ Wndproc is not receiving any messages when window is not focused
Maybe it would work
22 replies
CC#
Created by Pandetthe on 3/3/2024 in #help
✅ Wndproc is not receiving any messages when window is not focused
I found today something named message-only window
22 replies
CC#
Created by Pandetthe on 3/3/2024 in #help
✅ Wndproc is not receiving any messages when window is not focused
I know
22 replies