Add Rectangle to ContentControl C# wpf
Hello everyone! I hope this video has helped solve your questions and issues. This video is shared because a solution has been found for the question/problem. I create videos for questions that have solutions. If you have any other issues, feel free to reach out to me on Instagram: https://www.instagram.com/ky.emrah
Below, you can find the text related to the question/problem. In the video, the question will be presented first, followed by the answers. If the video moves too fast, feel free to pause and review the answers. If you need more detailed information, you can find the necessary sources and links at the bottom of this description. I hope this video has been helpful, and even if it doesn't directly solve your problem, it will guide you to the source of the solution. I'd appreciate it if you like the video and subscribe to my channel!Add Rectangle to ContentControl C# wpf
I have a Xaml Code in My Project Like This:
Window.Resources
!-- MoveThumb Template --
ControlTemplate x:Key="MoveThumbTemplate" TargetType="{x:Type local:MoveThumb}"
Rectangle Fill="Transparent"/
/ControlTemplate
!-- ResizeDecorator Template --
ControlTemplate x:Key="ResizeDecoratorTemplate" TargetType="{x:Type Control}"
Grid
local:ResizeThumb Height="3" Cursor="SizeNS" Margin="0 -4 0 0"
VerticalAlignment="Top" HorizontalAlignment="Stretch"/
local:ResizeThumb Width="3" Cursor="SizeWE" Margin="-4 0 0 0"
VerticalAlignment="Stretch" HorizontalAlignment="Left"/
local:ResizeThumb Width="3" Cursor="SizeWE" Margin="0 0 -4 0"
VerticalAlignment="Stretch" HorizontalAlignment="Right"/
local:ResizeThumb Height="3" Cursor="SizeNS" Margin="0 0 0 -4"
VerticalAlignment="Bottom" HorizontalAlignment="Stretch"/
local:ResizeThumb Width="7" Height="7" Cursor="SizeNWSE" Margin="-6 -6 0 0"
VerticalAlignment="Top" HorizontalAlignment="Left"/
local:ResizeThumb Width="7" Height="7" Cursor="SizeNESW" Margin="0 -6 -6 0"
VerticalAlignment="Top" HorizontalAlignment="Right"/
local:ResizeThumb Width="7" Height="7" Cursor="SizeNESW" Margin="-6 0 0 -6"
VerticalAlignment="Bottom" HorizontalAlignment="Left"/
local:ResizeThumb Width="7" Height="7" Cursor="SizeNWSE" Margin="0 0 -6 -6"
VerticalAlignment="Bottom" HorizontalAlignment="Right"/
/Grid
/ControlTemplate
!-- Designer Item Template--
ControlTemplate x:Key="DesignerItemTemplate" TargetType="ContentControl"
Grid DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
local:MoveThumb Template="{StaticResource MoveThumbTemplate}" Cursor="SizeAll"/
Control Template="{StaticResource ResizeDecoratorTemplate}"/
ContentPresenter Content="{TemplateBinding ContentControl.Content}"/
/Grid
/ControlTemplate
/Window.Resources
....
Canvas x:Name="Container" Background="Transparent" **strong text**
ContentControl
Width="130" MinWidth="50" Height="130"
MinHeight="50" Canvas.Top="150" Canvas.Left="150"
Template="{StaticResource DesignerItemTemplate}"
Rectangle Fill="AliceBlue" Opacity="0.5" Margin="10" Stroke="Blue" StrokeThickness="1" RadiusX="0" /
/ContentControl
/Canvas
Window.Resources
!-- MoveThumb Template --
ControlTemplate x:Key="MoveThumbTemplate" TargetType="{x:Type local:MoveThumb}"
Rectangle Fill="Transparent"/
/ControlTemplate
!-- ResizeDecorator Template --
ControlTemplate x:Key="ResizeDecoratorTemplate" TargetType="{x:Type Control}"
Grid
local:ResizeThumb Height="3" Cursor="SizeNS" Margin="0 -4 0 0"
VerticalAlignment="Top" HorizontalAlignment="Stretch"/
local:ResizeThumb Width="3" Cursor="SizeWE" Margin="-4 0 0 0"
VerticalAlignment="Stretch" HorizontalAlignment="Left"/
Source of the question:
https://stackoverflow.com/questions/79014656
Question and source license information:
https://meta.stackexchange.com/help/licensing
https://stackoverflow.com/
Видео Add Rectangle to ContentControl C# wpf канала Emrah KAYA
Below, you can find the text related to the question/problem. In the video, the question will be presented first, followed by the answers. If the video moves too fast, feel free to pause and review the answers. If you need more detailed information, you can find the necessary sources and links at the bottom of this description. I hope this video has been helpful, and even if it doesn't directly solve your problem, it will guide you to the source of the solution. I'd appreciate it if you like the video and subscribe to my channel!Add Rectangle to ContentControl C# wpf
I have a Xaml Code in My Project Like This:
Window.Resources
!-- MoveThumb Template --
ControlTemplate x:Key="MoveThumbTemplate" TargetType="{x:Type local:MoveThumb}"
Rectangle Fill="Transparent"/
/ControlTemplate
!-- ResizeDecorator Template --
ControlTemplate x:Key="ResizeDecoratorTemplate" TargetType="{x:Type Control}"
Grid
local:ResizeThumb Height="3" Cursor="SizeNS" Margin="0 -4 0 0"
VerticalAlignment="Top" HorizontalAlignment="Stretch"/
local:ResizeThumb Width="3" Cursor="SizeWE" Margin="-4 0 0 0"
VerticalAlignment="Stretch" HorizontalAlignment="Left"/
local:ResizeThumb Width="3" Cursor="SizeWE" Margin="0 0 -4 0"
VerticalAlignment="Stretch" HorizontalAlignment="Right"/
local:ResizeThumb Height="3" Cursor="SizeNS" Margin="0 0 0 -4"
VerticalAlignment="Bottom" HorizontalAlignment="Stretch"/
local:ResizeThumb Width="7" Height="7" Cursor="SizeNWSE" Margin="-6 -6 0 0"
VerticalAlignment="Top" HorizontalAlignment="Left"/
local:ResizeThumb Width="7" Height="7" Cursor="SizeNESW" Margin="0 -6 -6 0"
VerticalAlignment="Top" HorizontalAlignment="Right"/
local:ResizeThumb Width="7" Height="7" Cursor="SizeNESW" Margin="-6 0 0 -6"
VerticalAlignment="Bottom" HorizontalAlignment="Left"/
local:ResizeThumb Width="7" Height="7" Cursor="SizeNWSE" Margin="0 0 -6 -6"
VerticalAlignment="Bottom" HorizontalAlignment="Right"/
/Grid
/ControlTemplate
!-- Designer Item Template--
ControlTemplate x:Key="DesignerItemTemplate" TargetType="ContentControl"
Grid DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
local:MoveThumb Template="{StaticResource MoveThumbTemplate}" Cursor="SizeAll"/
Control Template="{StaticResource ResizeDecoratorTemplate}"/
ContentPresenter Content="{TemplateBinding ContentControl.Content}"/
/Grid
/ControlTemplate
/Window.Resources
....
Canvas x:Name="Container" Background="Transparent" **strong text**
ContentControl
Width="130" MinWidth="50" Height="130"
MinHeight="50" Canvas.Top="150" Canvas.Left="150"
Template="{StaticResource DesignerItemTemplate}"
Rectangle Fill="AliceBlue" Opacity="0.5" Margin="10" Stroke="Blue" StrokeThickness="1" RadiusX="0" /
/ContentControl
/Canvas
Window.Resources
!-- MoveThumb Template --
ControlTemplate x:Key="MoveThumbTemplate" TargetType="{x:Type local:MoveThumb}"
Rectangle Fill="Transparent"/
/ControlTemplate
!-- ResizeDecorator Template --
ControlTemplate x:Key="ResizeDecoratorTemplate" TargetType="{x:Type Control}"
Grid
local:ResizeThumb Height="3" Cursor="SizeNS" Margin="0 -4 0 0"
VerticalAlignment="Top" HorizontalAlignment="Stretch"/
local:ResizeThumb Width="3" Cursor="SizeWE" Margin="-4 0 0 0"
VerticalAlignment="Stretch" HorizontalAlignment="Left"/
Source of the question:
https://stackoverflow.com/questions/79014656
Question and source license information:
https://meta.stackexchange.com/help/licensing
https://stackoverflow.com/
Видео Add Rectangle to ContentControl C# wpf канала Emrah KAYA
Комментарии отсутствуют
Информация о видео
16 ноября 2024 г. 4:40:10
00:01:12
Другие видео канала