Instead of making the textblock opacity 50%, I had an issue when the background was red and the foreground was white. I added a dependencyProperty PlaceholderTextColorBrush. So now I can control the colour of the text from the calling code. And no issue when the textrblock is visible. Instead of adding ZIndex, I did what you did in the source code. I put the scrollviwer first. This is so helpful thanks.
I had an unexpected visceral reaction to !(value is Thickness padding). I think in newer C#, you can now say (value is not Thickness padding) But it’s good to teach it the old way in case people aren’t on the latest. Thanks again for the great tutorial!
Great video! Very good WPF channel! Please make a video with controls: Search Control - with a drop down list of items when searching. And Wizard. Thank you!
Hi Sean, thank you for the excellent tutorial. This just made my day. I have a search bar that is displayed through a modal pop up where I wanted to clarify the functionality without cluttering the UI with additional components. I might also add a ViewBox to the component for possible icon support 😅
Great tutorial. I did run into one problem that took me a little while to figure out. When running the program, I was getting an "Object reference not set to an instance of an object" error. I had the IsEmptyProperty declaration ahead of the DependencyPropertyKey IsEmptyPropertyKey declaration. The IsEmptyProperty declaration has to be after the IsEmptyPropertyKey declaration in order to initialize it at the correct time during startup.
Hi Sean, thanks for the tutorial. I wanted to ask if there is a reason why you don't inherit from MarkupExtension in your converter. It gives you the option to use the converter from the WPF without resource definition. It is, however, an abstract class. I saw it some time ago, and now I use it all the time, but maybe it's not that good. Or is that just a subjective preference? Thanks.
Hi Sean, excellent explanation, so you can reduce code in XAML. Are you maybe planning to make a Placeholder for PasswordBox? it would be great if you have time to do what I just mentioned. take care and keep up the excellent work
Hey MGA, I think that would be useful! I imagine it would be very similar to this implementation, but just using a bindable PasswordBox instead of a TextBox. I wish PasswordBox and TextBox were more interchangeable though. Anyways, good suggestion! I will consider implementing this. Thanks!
Hello Sean, Great tutorial as usual. I have been following this tutorial to make a Textbox with Floating Label and Hint that changes visibility and Animates when the TextBox gets IsKeyboardFocused. I was wondering how will you approach TemplateBinding a dependency property (eg. IsFocusedBorderColour) inside a Trigger and apply that to the BorderBrush, so that in use case one can give the brush in a window, page or user control. and in addition to that can create a default style theme that can be referenced to in xaml. My attempts failed so far, and seems Binding instead of TemplateBinding is required? Sorry for the long question and if it is out of topic. Regards
Hey Tanzib! I've had similar issues with TemplateBinding in the past. As you suggested, I think we'd have to use a regular Binding. Have you tried a Binding with RelativeSource=TemplatedParent?
@@SingletonSean Hi Sean, I tried TemplatedParent and Ancestor. It works but if I create a base style in the application project Resource.Dictionery. and do not pass a parameter for the property when I impliment the control in a user Control, it throws a null exception.
@@SingletonSean I was thinking is there a way to declare a brush in the custom control and template bind the brush to the dependency property? And call that brush in the trigger as DynamicResource?
A 12 minutes video for a placeholder. I think this is the point where I leave the WPF path and do something useful with my lifetime.
Instead of making the textblock opacity 50%, I had an issue when the background was red and the foreground was white. I added a dependencyProperty PlaceholderTextColorBrush. So now I can control the colour of the text from the calling code. And no issue when the textrblock is visible. Instead of adding ZIndex, I did what you did in the source code. I put the scrollviwer first. This is so helpful thanks.
Your step-by-step with trial and error approach makes the how and why easy to follow and instructive. 👍
This could not have come at a better time. Thanks!
I had an unexpected visceral reaction to !(value is Thickness padding).
I think in newer C#, you can now say (value is not Thickness padding)
But it’s good to teach it the old way in case people aren’t on the latest.
Thanks again for the great tutorial!
Great video! Very good WPF channel! Please make a video with controls: Search Control - with a drop down list of items when searching. And Wizard. Thank you!
I was just looking for how to make a TexBox with an icon and an inscription inside. THX
Hi Sean, thank you for the excellent tutorial. This just made my day. I have a search bar that is displayed through a modal pop up where I wanted to clarify the functionality without cluttering the UI with additional components.
I might also add a ViewBox to the component for possible icon support 😅
Haha, great timing MsQlan! Glad this was helpful, I definitely agree that this is great for reducing UI clutter.
Another great video! Thanks
Great tutorial. I did run into one problem that took me a little while to figure out. When running the program, I was getting an "Object reference not set to an instance of an object" error. I had the IsEmptyProperty declaration ahead of the DependencyPropertyKey IsEmptyPropertyKey declaration. The IsEmptyProperty declaration has to be after the IsEmptyPropertyKey declaration in order to initialize it at the correct time during startup.
Hi Sean, thanks for the tutorial. I wanted to ask if there is a reason why you don't inherit from MarkupExtension in your converter. It gives you the option to use the converter from the WPF without resource definition. It is, however, an abstract class. I saw it some time ago, and now I use it all the time, but maybe it's not that good. Or is that just a subjective preference? Thanks.
Thank you very much!
Question - how it is possible to make in TextBox a cross tag for search cancellation command?
Hey, thanks for the very useful tutorial. Do you know how refresh(with mvvm) Listbox content?
can you make the video for a custom chart using wpf MVVM
How style custom control from library? custom control do not apply defined covered style for TextBox, I must define key name?
Hi Sean,
excellent explanation, so you can reduce code in XAML.
Are you maybe planning to make a Placeholder for PasswordBox? it would be great if you have time to do what I just mentioned.
take care and keep up the excellent work
Hey MGA, I think that would be useful! I imagine it would be very similar to this implementation, but just using a bindable PasswordBox instead of a TextBox. I wish PasswordBox and TextBox were more interchangeable though. Anyways, good suggestion! I will consider implementing this. Thanks!
Hello Sean, Great tutorial as usual.
I have been following this tutorial to make a Textbox with Floating Label and Hint that changes visibility and Animates when the TextBox gets IsKeyboardFocused.
I was wondering how will you approach TemplateBinding a dependency property (eg. IsFocusedBorderColour) inside a Trigger and apply that to the BorderBrush, so that in use case one can give the brush in a window, page or user control. and in addition to that can create a default style theme that can be referenced to in xaml. My attempts failed so far, and seems Binding instead of TemplateBinding is required? Sorry for the long question and if it is out of topic.
Regards
Hey Tanzib! I've had similar issues with TemplateBinding in the past. As you suggested, I think we'd have to use a regular Binding. Have you tried a Binding with RelativeSource=TemplatedParent?
@@SingletonSean Hi Sean, I tried TemplatedParent and Ancestor. It works but if I create a base style in the application project Resource.Dictionery. and do not pass a parameter for the property when I impliment the control in a user Control, it throws a null exception.
@@SingletonSean I was thinking is there a way to declare a brush in the custom control and template bind the brush to the dependency property? And call that brush in the trigger as DynamicResource?
Have you considered an adorner instead?
in python you'd use placeholdertext="Placeholder Text" but i guess wpf is too modern for that
Yep WPF likes to challenge us 😂
WindowsForms did it that simple as well, why WPF whyy
WPF is very powerful once you get used to creating your own custom controls, but its library of base controls is half baked.
@@marcocito9269 yeah but i use electron, might be slower but a 100 times easier