WPF Custom User Control + Dependency Properties

  Рет қаралды 56,378

ToskersCorner

ToskersCorner

Күн бұрын

In this video we create a simple custom user control which acts as a spoiler button for displaying and collapsing content behind it. We also vaguely cover using dependency properties and how to implement our new custom control.
Button Style Code: pastebin.com/TqdABJKf
MainWindow.xaml: pastebin.com/M8tKwxUP
SpoilerControl.xaml: pastebin.com/H1JmChAH
SpoilerControl.cs: pastebin.com/YwtGVhEh
More Info: docs.microsoft.com/en-us/dotn...
** Tip Jar **
Paypal: toskerscorner@outlook.com
BTC: 3DkvwvcQ8Vt2U84jdtEhNBx2Ueai3Xttmu
ETH: 0xFf79A145e1ED6F538607Ec374968e605cbea758b
BCH: qqpgrnzuhc5hav4e79m8nfhmugs46jtl0ujxcu0tj5
LTC: MHXQmJA3hkwTPeArB9QPNkcLiHQx723yMb

Пікірлер: 36
@ToskersCorner
@ToskersCorner 5 жыл бұрын
Full Source Code: github.com/Tosker/ContactBook-Tutorial
@shvideo1
@shvideo1 Ай бұрын
Great tutorial with a very practical example. Great job. Thank you.
@longuinni
@longuinni 6 жыл бұрын
Great video!!! Really easy to understand.
@BarnsWills
@BarnsWills 3 жыл бұрын
Saved me loads of time! Cheers!
@myx555
@myx555 3 жыл бұрын
3:19 - Says "But" and types "
@d4rkw34v3r
@d4rkw34v3r 6 жыл бұрын
Awesome video! Thank you very much.
@solvedplus858
@solvedplus858 4 жыл бұрын
this is very good and simple many thanks for your greet tutorial
@stratman1234
@stratman1234 4 жыл бұрын
This is very helpful. I didn't know about setting the Name property of the UserControl and the using the ElementName to get the property. Great job!!
@valnuke
@valnuke 5 жыл бұрын
excellent video
@jackzhang8097
@jackzhang8097 4 жыл бұрын
When I bind the ViewModel property to the dependency property of the custom UserControl, the UI interface is not updated after the data is updated. Do you know why?
@ChantingInTheDark
@ChantingInTheDark 2 жыл бұрын
Thanks, this helped, I had everything right on my own except this one part: ElementName= when binding the property to the user control's XAML. I'm curious what the other methods were you mentioned.
@shameerminhas9152
@shameerminhas9152 Жыл бұрын
Genius
@KD-xp4di
@KD-xp4di 5 жыл бұрын
Hehehe thank you for the warning
@kumarharsh8931
@kumarharsh8931 5 жыл бұрын
is it possible to create Custom usercontrol with mvvm where we should not have Dp in code behind rather in viewModel?
@shaihulud4515
@shaihulud4515 5 жыл бұрын
Actually you can, by using XAML. It's called control.template. So, e.g. create a radiobutton-style, create a control.template tag and throw in a togglebutton for instance. Voila.
@moppetskitzo9521
@moppetskitzo9521 5 жыл бұрын
in description SpoilerControl.cs link follows to same XAML code as SpoilerControl.xaml
@ToskersCorner
@ToskersCorner 5 жыл бұрын
Sorry about that. Full source code is available here: github.com/Tosker/ContactBook-Tutorial
@hishoegypt1980
@hishoegypt1980 Жыл бұрын
Q: how to make a style in the main window for the new usercontrol and the style contain the dependency properties of the usercontrol?
@ImDeesu
@ImDeesu 6 жыл бұрын
What is the difference between TargetType="Button" and TargetType="{x:Type Button}"?
@ToskersCorner
@ToskersCorner 6 жыл бұрын
Virtually no difference!
@ImDeesu
@ImDeesu 6 жыл бұрын
Oh! Thank you then :^)
@fooballers7883
@fooballers7883 10 ай бұрын
thanks...much appreciated.
@francoisdeklerk1266
@francoisdeklerk1266 6 жыл бұрын
Audio?
@ToskersCorner
@ToskersCorner 6 жыл бұрын
There is audio, perhaps it is quiet for you? Seems fine for me.
@francoisdeklerk1266
@francoisdeklerk1266 6 жыл бұрын
Appreciate your videos, man!! Yes, the audio seems to very quite
@ToskersCorner
@ToskersCorner 6 жыл бұрын
Thanks! And sorry to hear that. Perhaps a pair of head phones or checking your settings might help.
@francoisdeklerk1266
@francoisdeklerk1266 6 жыл бұрын
Thank you very much for your tutorials. I think you deserve more views than what your'e getting
@levelheaded6214
@levelheaded6214 4 жыл бұрын
@@ToskersCorner I had to CRANK the volume way up as well. Good vid.
@AndrewVaderUKS
@AndrewVaderUKS 5 жыл бұрын
in description SpoilerControl.cs link follows to same XAML code as SpoilerControl.xaml
@ToskersCorner
@ToskersCorner 5 жыл бұрын
Sorry about that. Full source code is available here: github.com/Tosker/ContactBook-Tutorial
Dependency Properties in WPF
19:24
DotNetSkoool
Рет қаралды 113 М.
Mama vs Son vs Daddy 😭🤣
00:13
DADDYSON SHOW
Рет қаралды 50 МЛН
Inside Out 2: Who is the strongest? Joy vs Envy vs Anger #shorts #animation
00:22
Ouch.. 🤕
00:30
Celine & Michiel
Рет қаралды 25 МЛН
Inside Out Babies (Inside Out Animation)
00:21
FASH
Рет қаралды 23 МЛН
WPF Custom Dialogs - Part 2 [Dialog Controls]
12:22
ToskersCorner
Рет қаралды 11 М.
Creating Reusable Controls - WPF TUTORIALS
17:10
SingletonSean
Рет қаралды 30 М.
WPF Contact Book - Part 2 [Main Window & Styles]
10:02
ToskersCorner
Рет қаралды 6 М.
WPF Custom Dialogs - Part 1 [Dialog Service]
11:53
ToskersCorner
Рет қаралды 23 М.
XAML Custom Control Введение
16:18
АйТи Гопник
Рет қаралды 851
C# WPF Tutorial #21 - Styles and ControlTemplates
12:53
Kampa Plays
Рет қаралды 16 М.
XAML WPF - Styles Part 1, Window Resources
11:53
ToskersCorner
Рет қаралды 39 М.
The Basics of Data Binding in WPF
20:53
Tactic Devs
Рет қаралды 38 М.
Dependency Properties - WPF CUSTOM CONTROLS #2
10:53
SingletonSean
Рет қаралды 23 М.
C# WPF - Commands [Part 1 Intro + Singular Commands]
17:32
ToskersCorner
Рет қаралды 50 М.
Mama vs Son vs Daddy 😭🤣
00:13
DADDYSON SHOW
Рет қаралды 50 МЛН