WPF Controls: Learn basic WPF controls in C#

  Рет қаралды 178,872

IAmTimCorey

IAmTimCorey

Күн бұрын

Newsletter signup (with exclusive discounts): signup.iamtimcorey.com/ (your email will be kept safe and you will not be spammed).
Facebook Page: / iamtimcorey
Want to see a full C# application built from scratch?
Check out this course: iamtimcorey.com/courses/cshar...
Need to know SQL Better? Check out this course: iamtimcorey.com/product/sql-d...
In this video, I will introduce you to some of the common WPF controls. Included will be the ComboBox, ListBox, StackPanel, WrapPanel, ScrollViewer, Image control, MediaElement, and more. After watching this video, you should be able to get started building something great.
0:00 - Intro
0:29 - ComboBox
2:53 - ComBobox Data: Creating a List of T
4:06 - ComBobox Data: Assign a List of T to the ComboBox and display property of T
9:37 - Image
12:18 - MediaElement
14:22 - StackPanel
18:22 - WrapPanel
20:44 - ScrollViewer
23:05 - StackPanel inside ComboBox
26:18 - Item Parent and placement
28:20 - Summary and concluding remarks
Thanks to Ralfs HBK for the chapter breakdown

Пікірлер: 194
@domipetocz
@domipetocz 3 жыл бұрын
Even 3 years later these are the best you can find
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Thanks!
@VaderFaderVader
@VaderFaderVader 7 жыл бұрын
Awesome news about the WPF-port for "From Start To Finish" - can't wait for that one . . . Good work so far!
@IAmTimCorey
@IAmTimCorey 7 жыл бұрын
Yep, that one got an overwhelming response. Still trying to figure out how I'm going to do it but it will definitely happen.
@DaveDickens
@DaveDickens 2 жыл бұрын
Hi Tim, just getting back into WPF from a 10 year break, your intro videos are just the job. Thank you. Cheers Dave
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
I am glad they were so helpful.
@nickeax
@nickeax 4 жыл бұрын
Very practical and you pick up so many gotchas that many beginners would otherwise be wondering about. Thanks for the amazing content Tim.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are most welcome. Thanks for watching.
@jairosnyirenda
@jairosnyirenda 2 жыл бұрын
Wow!!! Just so in love with WPF now... Thank you Tim!!!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Awesome!
@RalfsBalodis
@RalfsBalodis 3 жыл бұрын
<a href="#" class="seekto" data-time="0">0:00</a> - Intro <a href="#" class="seekto" data-time="29">0:29</a> - ComboBox <a href="#" class="seekto" data-time="173">2:53</a> - ComBobox Data: Creating a List of T <a href="#" class="seekto" data-time="246">4:06</a> - ComBobox Data: Assign a List of T to the ComboBox and display property of T <a href="#" class="seekto" data-time="577">9:37</a> - Image <a href="#" class="seekto" data-time="738">12:18</a> - MediaElement <a href="#" class="seekto" data-time="862">14:22</a> - StackPanel <a href="#" class="seekto" data-time="1102">18:22</a> - WrapPanel <a href="#" class="seekto" data-time="1244">20:44</a> - ScrollViewer <a href="#" class="seekto" data-time="1385">23:05</a> - StackPanel inside ComboBox <a href="#" class="seekto" data-time="1578">26:18</a> - Item Parent and placement <a href="#" class="seekto" data-time="1700">28:20</a> - Summary and concluding remarks
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Thank you!
5 жыл бұрын
Thank´s a lot... I'm trying to move from VBA to VSTO and XAML... You are making this task easy!! Hugs from Brazil!!
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Excellent! I'm glad these videos are a help.
@Maddy-cy9fu
@Maddy-cy9fu 7 ай бұрын
I spent a ton of time trying to figure out the ins and outs with the newer Win UI3. There was no beginner-friendly resources, especially ones that focussed more on the 'how' and 'why' instead of 'what' when it comes to XAML. I'm so glad I took a step back to WPF, as your tutorials are very comprehensive and put many of the principles into perspective. A few years late, but I just wanted to say thank you so much!
@IAmTimCorey
@IAmTimCorey 7 ай бұрын
I am glad it was helpful.
@jannickbreunis
@jannickbreunis 3 жыл бұрын
Really awesome features, good video! Looking forward seeing datagridview-ish controls.. I am hyped seeing only the controls in this videos.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Glad you liked it.
@StreetBladerBloke
@StreetBladerBloke 7 жыл бұрын
your teaching method is excellent. just waiting your WPF update to your original course....thanks for passing the knowledge
@IAmTimCorey
@IAmTimCorey 7 жыл бұрын
I appreciate it.
@RaviShankar-fq3ex
@RaviShankar-fq3ex 6 жыл бұрын
You are brilliant tutor. This is my first video of WPF, infact new to C# but your tutorial is really helpful for a beginner like me to start with.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
I'm glad this video was helpful.
@josephmarsh5031
@josephmarsh5031 6 жыл бұрын
I like the Scroll viewer. thanks for showing these controls! :)
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
You are welcome.
@user-jd1zx
@user-jd1zx 6 жыл бұрын
Thank you for sharing these great tuts
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
You are welcome.
@theshubhagrwl
@theshubhagrwl 6 жыл бұрын
Thanks a lot for this. This cleared my doubts
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Awesome.
@rodelioliwag7627
@rodelioliwag7627 Жыл бұрын
Thank you very much. This is very informative
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are very welcome.
@Wilhuff
@Wilhuff 3 жыл бұрын
As an old dinosaur doing winforms for almost 20 years, thank you it is a good introduction to WPF. Will switch to WPF soon
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Awesome!
@panduevank8356
@panduevank8356 6 жыл бұрын
This is some amazing teaching skill here.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Thanks again!
@Matrix21rms
@Matrix21rms 5 жыл бұрын
I just clicked the Like button , but where is the love button :D!! very good video. I'm working with WPF and MVVM pattern also for a work project, but with this videos I'm filling up my gaps, I really trust that the tutorial will be more complex (the future tutorials) so thanks for your time. !
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
I am glad you enjoyed the content.
@anuragdongre4942
@anuragdongre4942 Ай бұрын
Very helpful. Thanks
@IAmTimCorey
@IAmTimCorey Ай бұрын
You are welcome.
@jennifertran8802
@jennifertran8802 6 жыл бұрын
Excellent teaching
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Thank you.
@Techie_Nation
@Techie_Nation 7 жыл бұрын
best tutorials still i have found related WPF !
@IAmTimCorey
@IAmTimCorey 7 жыл бұрын
I'm glad you like them.
@farazqureshi3275
@farazqureshi3275 6 жыл бұрын
Awesome tutorial Please upload more videos of WPF !!!!!!!!! please Your are great
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Thanks! And yes, more WPF videos are coming.
@barrythorne693
@barrythorne693 3 жыл бұрын
Brilliant!
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Thanks
@DaNoob_777
@DaNoob_777 2 жыл бұрын
Thanks!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Thank you!
@AlexanderBaranski
@AlexanderBaranski 4 жыл бұрын
played with WrapPanel Inside the ScrollViewer, when you disable the default VerticalscrollBarVisibility="Visible" to Disable, the WrapPanel with Orientation="Vertical" works just fine again :) if you think about it, as long as you can scroll, the WrapPanel dont need to Wrap, first when the Scrolling in Vertical-Side is disabled, it's need to wrap and does so
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks for sharing.
@_.emberrr
@_.emberrr 2 жыл бұрын
I spent my sweet time messing around with the stackpanel and image elements before finally moving on XD
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
That's ok. Learning by trying things out is an excellent teacher.
@LGKuyperjr
@LGKuyperjr 4 жыл бұрын
Great thank you
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@janslanina2209
@janslanina2209 Жыл бұрын
Hello mr. Corey, I might be late to the party few years. Just realised the MediaElement is media and video probably because since I didnt have video, I was able to add MP4, which doesnt contain any image, just sound. Might be because you can add more elements than just video. And by the way, thanks for this tutorial ! The way you explain things is awesome :)
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Great!
@LurkerRIP970
@LurkerRIP970 6 жыл бұрын
Tim, Would you consider doing another WPF video. Couple of thing I am interested in is: 1. Animations. 2. Data Grids 3. Custom Contols
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
I will definitely be doing another WPF video and these are good topics to be sure are on the list. Thanks for the suggestions.
@JoshyHJoshy
@JoshyHJoshy 4 жыл бұрын
This is a great continuation of the intro video to WPF. I wonder if there is a sequel to "this" video?
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
There is a whole playlist for WPF here: kzbin.info/aero/PLLWMQd6PeGY3QEHCmCWaUKNhmFFdIDxE8 plus I use WPF in the TimCo Retail Manager series.
@thejewelofthenile202
@thejewelofthenile202 7 жыл бұрын
If somebody has a problem with playing video ( <a href="#" class="seekto" data-time="795">13:15</a> ) there is a solution: 1. Right click your video file in the solution explorer and chose "properties". 2. Make sure Build Action is set to "Content". 3. Make sure Copy to output is set to "Copy Always" or "Copy if Newer".
@IAmTimCorey
@IAmTimCorey 7 жыл бұрын
Thanks for the tip!
@thejewelofthenile202
@thejewelofthenile202 7 жыл бұрын
Thanks for this tutorial! :)
@anthonyyan1
@anthonyyan1 3 жыл бұрын
@@IAmTimCorey 夷卍了”。金一杠力s Mdddjjddi
@martinled2151
@martinled2151 3 жыл бұрын
Hi Tim, Great videos I must say! is it possible to make a video where you, take the user input from the textboxes and saves them in a .txt file? I'm trying to make a simple string creator tool in WPF. And alså with the combo boxes. How is it possible to, show the same as you are doing in the video, but where it reads from a .txt file instead. Hope you understand what I mean. I'm pretty new to programming. I'm looking at your videos to learn, you are a great teacher! :D
@gabesztm
@gabesztm 4 жыл бұрын
MediaElement supports also .mp3 files, so maybe that's why it is not called only VideoElement. Thank you for the tutorial!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Good thought.
@user-tn3bw1wg8w
@user-tn3bw1wg8w 5 жыл бұрын
Nice 👍
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Thanks!
@ninaligo
@ninaligo 3 жыл бұрын
Hey, you make amazing videos! I wanted to know if you could recommend what I should do about this. I'm wanting to make an IPTV m3u channel list application, which lists channels with a timeline of the shows that premiere at a certain time. Normally there are about 1500+ channels and even more shows. Do you know any good way to show this data without crashing and lagging the whole window? I tried this in WinForms and it is just a complete lag disaster. I wanted to make a list menu on the left side, and when you go to click the item it brings up the channel information on the right. Thank you Tim! Or if you have another suggestion of how I should show this data?
@joshuawaheed
@joshuawaheed Жыл бұрын
I would be curious to see how to create custom WPF controls from simple to complex.
@willgordon5737
@willgordon5737 10 күн бұрын
Man WRAPPANEL and other controls in WPF we take it for granted, just imagine implementing that in C++ all those manual resizing and re renderings. All of that math you have to perform manually, I'm glad I am a C# programmer.
@IAmTimCorey
@IAmTimCorey 9 күн бұрын
Yep, there are LOTS of benefits.
@slowbrain8869
@slowbrain8869 4 жыл бұрын
<a href="#" class="seekto" data-time="390">6:30</a> three days i ve been stuck on this , tried all sorts of shit to display the fkin names on list box , then i figured it out by using linq i sorted lists.Name option, then when i tried to deleted the particular item i coudnt able to get the id of that particular item,. Engneering is a hard if not guided in a right way , thanks for his sir...i will watch all of your videos and siply write a comment , thats all i can do atm
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I am glad you got it figured out.
@SuperJV4x
@SuperJV4x 5 жыл бұрын
I cannot seem to find anyone with a video on how to instantiate a controltemplate or usercontrol in code behind. This is totally needed for cases when data is driving how many controls you need at run time, for example an image grid where you load according to how many pics returned by a sql statement, etc.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
I can add that to the suggestion list.
@ashwaniyadav3661
@ashwaniyadav3661 4 жыл бұрын
You are a great teacher i wish we had teachers like you in my college, As Indian's we proud of our IT sector but our institute's lake good teachers, love from India
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I appreciate the kind words.
@fletcherdukakis934
@fletcherdukakis934 7 жыл бұрын
Great tutorial! Any thoughts as to why resizing my form (after adding the image control) also resized my text box and combobox? I notice the same doesn't occur in your demo app, and I think we have the same markup code.
@IAmTimCorey
@IAmTimCorey 7 жыл бұрын
Look at your column definitions. If you don't have the star column, each column will resize to fill the space. The other option is that you have your controls in a star column.
@bsm9990
@bsm9990 7 жыл бұрын
Hi Tim, great tutorial as always. I started to make simple classic games in C# like snake, tetris, pong etc.I have already made Snake in Windows Forms. Now I want to try WPF, so I have few questions. 1.In WF I used the pictureBox control and the Graphics class to draw shapes. What should I use in WPF ? 2. How to correctly center a form on different screen resolutions? When I use the property WindowStartupLocation = "CenterScreen", it works only for resolutions greater than specified form size, otherwise it's cut vertically.
@IAmTimCorey
@IAmTimCorey 7 жыл бұрын
Classic games in WPF are much more possible in WPF. Unlike WinForms, where you were pushing the edge to get anything to work, WPF is designed for movement and drawing. In fact, all of the controls have the ability to animate and change built-in. I'd start by checking out this article: docs.microsoft.com/en-us/dotnet/framework/wpf/graphics-multimedia/animation-overview Then I'd look at this article: www.c-sharpcorner.com/UploadFile/52f7b2/wormrace-using-wpf-animations/ Those two should get you started not just in drawing the shapes but in animating the movement. As for question two, I think you are mostly at your solution. I would just do a check on startup to see what the screen resolution is, and if it is smaller than the form, just maximize the form. Then it will take the available space, and even though it isn't as much as you want, at least you won't have any off-screen issues. Then you just need to make sure your form can run at the smaller size without an issue.
@bsm9990
@bsm9990 7 жыл бұрын
Thanks for the tips. PS: If someone had a problem with moving shapes using the Canvas.SetTop (Left, Right ...) method and the timer tick event. You must first initialize the Top value for shape in C# or XAML XAML: Canvas.Top = "0" C#: Canvas.SetTop (shape, 0); Then you can use this in your timer tick Canvas.SetTop (shape, Canvas.GetTop (shape) + value); It took me a few hours to get it working .... I should use WPF animation :))
@serghus6317
@serghus6317 4 жыл бұрын
Thank you Tim, great as usual. Small question: is it possible in the ComboBox.ItemTemplate -> DataTemplate -> Image to bind the Source property to the Method : IsTim() and to pass the Parameter FirstName, so that the picture in the ComboBoxItems is shown only when the FirstName is "Tim"?
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Yes, it is possible to do that. I don't have an example to show you though.
@nonsensepoem
@nonsensepoem 3 жыл бұрын
This is so helpful! Is there any chance you can talk about embedding a web browser element and working with the DOM (doing all of CRUD) in a WPF app?
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 3 жыл бұрын
Have you looked thru Tim's fill WPF playlist? kzbin.info/aero/PLLWMQd6PeGY3QEHCmCWaUKNhmFFdIDxE8
@nonsensepoem
@nonsensepoem 3 жыл бұрын
@@tomthelestaff-iamtimcorey7597 I haven't yet watched them all, but on scrubbing through them I see no use of an embedded web browser tool. Am I missing something?
@shawnmofid7131
@shawnmofid7131 5 жыл бұрын
Great content as always. Thank you so much. I ran into a small problem with not having permission to load an image from my pictures folder into the app, but once I created a C:\temp folder and moved the image to it, it loaded fine. Is WPF similar to WinRT in that I have to add a capability to a manifest file? I looked for a similar file, but I could not find it. I did look in App.config. I also thought I may have to add that image to the resources, but they don't look like folder that you can add files to.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Nope, it isn't like WinRT. You have the full capabilities of whatever user is running it (although you need to elevate it if you want access to admin-level items).
@byolock6244
@byolock6244 3 жыл бұрын
So im trying to display a list with data binding, but the problem I have is that newly added items get added to the ui but if i change the name of an already displayed item it doesn't refresh. Is this intendet behaviour and i have to do something to refresh it or is this bug of some kind i have here.
@jymmorton5612
@jymmorton5612 6 жыл бұрын
At around 4 mins. 15 seconds you add the code myComboBox.ItemsSource = people; to the MainWindow() My question: Is that just a preference or is it because it's a List? I was following along with an ObservableCollection and in the XAML seems to work. Is this a valid way to do it as well?
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Good question. First of all, I tend to do bindings like this in code because I can control the timing of when it gets added better. Second, I try not to put bindings directly in the XAML. It is just one more place I have to remember to update when I change the list or otherwise modify the binding. Third, having all of the data manipulation in the code behind (or, better yet, in a ViewModel) allows me to more easily see what is happening by looking in just one spot. With that said, there is nothing wrong with the way you are doing it. It is definitely a valid solution.
@DanaiLuiz
@DanaiLuiz 5 жыл бұрын
Hello Tim, thank you for the amazing videos! I have a problem with the ScrollViewer. My code is exactly like yours, but the scrollbar is greyed out. Btw I'm using Visual Studio Community 2017 Version 15.9.7 Any suggestions?
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Is it actually big enough to scroll?
@DanaiLuiz
@DanaiLuiz 5 жыл бұрын
@@IAmTimCorey Thanks for the fast reply! Yes, I'm able to see just two of the images, but the other elements have been pushed to the bottom of the window. 😕
@Kaalund1989
@Kaalund1989 3 жыл бұрын
sorry for this late question, but maybe i am lucky :) . the DataTemplate, its it possible in VS to save it as a "external file" and just refer to it instead. So i can have seperate files whit difrent templates so its easyer to work whit and se whats happening :) sorry about the bad Eng not my first lang. Thx
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
If I understand your question then the answer is no, you cannot.
@Kaalund1989
@Kaalund1989 3 жыл бұрын
IAmTimCorey okay thanks :)
@jteasler
@jteasler 6 жыл бұрын
Datagrid Bindings are something I am struggling with. Especially ComboBoxes in a datagrid.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
I don't have a video that covers that but this StackOverflow topic might help: stackoverflow.com/questions/5409259/binding-itemssource-of-a-comboboxcolumn-in-wpf-datagrid
@jeremyflowers8908
@jeremyflowers8908 5 жыл бұрын
@<a href="#" class="seekto" data-time="1319">21:59</a> - that doesn't work for me - a ScrollViewer with nested StackPanel, which in turn has the 4 images. I get scrollbars - but they are disabled. Setting MaxHeight="250" on ScrollViewer fixes it though. Also if you take the Orientation off the WrapPanel if it's nested it will work as expected - again with the MaxHeight set on the ScrollViewer.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Interesting.
@charlesayeni
@charlesayeni Жыл бұрын
thanks for the fix
@frankvandiepenbos9905
@frankvandiepenbos9905 4 жыл бұрын
Hello Tim, I'd like to bind Radiobuttons to a boolean but I read this: The radio button control has a known issue with data binding. If you bind the IsChecked property to a boolean and check the RadioButton, the value gets True. But when you check another RadioButton, the databound value still remains true. Would you say that is still the case and one needs to make a workaround for it?
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
If you are doing manual binding, here is a solution: www.wpftutorial.net/RadioButton.html If you are using Caliburn Micro, it is even easier: stackoverflow.com/questions/14341484/set-radiobutton-checked-in-code-with-caliburn-micro
@StefanKo1224
@StefanKo1224 4 жыл бұрын
Can u say to me, what source is the best to use to learn wpf and c# programing? By the way,ur tutorials is the best
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
My Foundation in C# course series is the best place to start. It will give you a firm understanding of all of C# and it will also cover the start of WPF. That way you are ready to progress to more in-depth learning on WPF. Here is a video that shows you more about how to get started: kzbin.info/www/bejne/gobZY2OHrb2dnNk
@TochkaZreniya
@TochkaZreniya 4 жыл бұрын
Hi Tim, first, thank you for your videos. I noticed that the images don't render smoothly as they are resized in your demo (they appear jagged.) Is this just the way it is with WPF, or is there some way to correct that?
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I believe that had to do with the image I was using and the pixel density of it. I don't think that was a WPF issue.
@TochkaZreniya
@TochkaZreniya 4 жыл бұрын
@@IAmTimCorey ah, thank you! By the way, after watching your video on MVVM with Caliburn Micro, I visited the project's website where I saw a recent announcement that it is no longer going to be maintained. It makes me not want to invest in using it. Perhaps an idea for a newer video on this topic covering an alternative to CM.
@ghiancarlostan8730
@ghiancarlostan8730 2 жыл бұрын
hey corey, I hope youll reply. So I was following your steps and then I had a problem in the mediaelement part. It doesnt show in the editor view as well as in runtime. I tried dragging it into the form but an error message popped up "The media file (filepath) could not be opened. Windows Media Player version 10 or later is required." I don't know what it means I'm pretty noob when it comes to these things. I hope you can help. I am currently using windows 11, I dont know what windows media player it is talking about...
@stepbystepwithhenry4196
@stepbystepwithhenry4196 5 жыл бұрын
Suggestion: Admittedly, this is 'young grasshopper' opining to 'Master Yoda' (and mixing about 3 generations of metaphors along the way...), but may I suggest that to give students a fuller understanding of ComboBoxes, that you start by saying something like "There are 2 ways to populate a ComboBox: Statically and dynamically. Statically is just like adding a Master Card , etc for each option. Pretty simple. Now the really interesting and more typical is a dynamic, data-driven one like this PEOPLE example I'm going to show you...". One on-going disappointment I have with a LOT of training courses is that they often show only one way (like the above), but do not even allude to any other options, misleading the student to think that there is no other way than the example shown. Thanks for listening :)
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
I hear you and I try to do that when I think it is important. However, in this case I'm not really a fan of encouraging people to add things to a combo box statically. You could argue that some things never change but I've been around long enough to know that isn't really true. Even if you had days of the week in the box, at some point someone is going to want to change those to abbreviations or they are going to want to localize them. Either way, you now have to open your application and recompile it.
@juanclopgar97
@juanclopgar97 4 жыл бұрын
Hi!, I'm new with wpf, but I've a lot of expierence with WF, and by the way, awesome vids!. My question is, in <a href="#" class="seekto" data-time="519">8:39</a> in the DataTemplate, you wrote But what happen if you have a colletion of any other object, and the Property name is not found. And, Is there a way to Write an Attribute in the property to "Select" that property to be shown in the combobox?. Thank you :D
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
If the property is not found, you would throw an exception. Not sure what you mean about selecting an attribute. You can show specific properties in a combobox (I have a video on that), if that is what you mean.
@juanclopgar97
@juanclopgar97 4 жыл бұрын
@@IAmTimCorey mm let me explain it: [PropertyToDisplayAttributte] public string PropertyName { get{ return "Hello";} } in that way, it doesn't matter the property name, you could just search the attributte ( I don't know if that's possible), and I'm asking that because. What happen if I try write a style template?, for example, for a combobox I need specify the DataTemplate in order to code how it suposse to show each Item, but if in other moment I want use exactly the same style but instead to show Persons, I want to show cars, how is this possible?, using an Interface? Thank you for your quick answer :D
@jorgemora1175
@jorgemora1175 5 жыл бұрын
Hi, how do I get the information from combobox to display in messagebox? how can I get the text show or get the reference to object person?
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
You need to get the selected item. In Caliburn Micro, this is fairly easy. You just specify the property that will store the SelectedItem and you are done. Now you can access that object in the ViewModel whenever you want.
@jorgemora1175
@jorgemora1175 5 жыл бұрын
@@IAmTimCorey thanks, after some time I figure out the use the operator "as" :(combo.selectedItem as Person).FirstName
@afgone123456
@afgone123456 6 жыл бұрын
Hi Tim, you didn't show how to expand the controls when resizing the window. thanks
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
I thought I did that in the previous WPF video but maybe not. Basically, put the control in an expanding column (one with a star for the size, not auto) then make sure the control does not have a width property (the same can be true for the row and height property if you want it to get taller too). Now when your form expands, so does your control.
@afgone123456
@afgone123456 6 жыл бұрын
Thank you
@terjes64
@terjes64 2 жыл бұрын
Why does one put design items like stackpanel inside the DataTemplate? Breaks with single responsibility?
@IAmTimCorey
@IAmTimCorey Жыл бұрын
No, single responsibility doesn't really apply here. This is about creating the correct layout for our data.
@tomdewilde7956
@tomdewilde7956 3 жыл бұрын
Notes to myself; <a href="#" class="seekto" data-time="380">6:20</a> : To connect a combobox to a propertie Firstname o/t class "Person"; add <a href="#" class="seekto" data-time="1236">20:36</a> : Scrollviewer
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 3 жыл бұрын
Thanks for the tip
@tomdewilde7956
@tomdewilde7956 3 жыл бұрын
@@tomthelestaff-iamtimcorey7597 ... i'm just making notes for myself ;-)
@mingosutu
@mingosutu 3 жыл бұрын
Hi, Thanks a lot. Why does my combox has it is main button on the side and not on top?
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
I'm not following what you mean. My button was below my combo box and that was because I put it in the next grid row down.
@mingosutu
@mingosutu 3 жыл бұрын
@@IAmTimCorey I mean the button on the combo box. It is on the side of the combo box not on top. Do I need to do something the orientation of combo box? Thanks. I hope you could understand me now.
@scottm.3084
@scottm.3084 3 жыл бұрын
I had the same problem. It turned out to be that Row 4 was set to "*"- so it made the row tall (using the remaining vertical space until reaching the "20" pixel row set for the bottom border). In my project, I an added an additional row (to the RowDefinitions), so row 4 now was "auto", and row 5 was "*".
@andrewthebladethrower8371
@andrewthebladethrower8371 2 жыл бұрын
sizing doesn’t work, image or media likewise. I tried adding specifiers like “fill” etc, reopening the studio, nope. Not just media window, but controls too. I can specify the size, but this isn’t cool. I am running VS on windows 7, I can see at the header the “markup-compatibility/2006, ..winfx/2006/xaml etc. Could that be the problem or should I look furher?
@andrewthebladethrower8371
@andrewthebladethrower8371 2 жыл бұрын
fixed
@ythotcore
@ythotcore 4 жыл бұрын
Trying the code in WPF for dotnet Core. I see that the main C# code looks quite different. Could you give a code example for the c# code (I am at about <a href="#" class="seekto" data-time="210">3:30</a> in the video). TIA. BTW very nice videos!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
If you look at the TimCo Retail Manager series when we upgrade to .NET Core, you will see how to set up a .NET Core WPF app.
@KonradSchK
@KonradSchK 5 жыл бұрын
You should explain in this course why it is a bad idea to have it all in the same class, and mention your MVVM videos. I got really confused because i started making multiple classes, for the list and for the person. My mistake jumping ahead
@KonradSchK
@KonradSchK 5 жыл бұрын
¨Btw. This is way more informative and goalongtoo than the way my teacher does. Amazing
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
I do explain that in some videos but I don't in all of them. One class per file. That's the best practice.
@sharmafamilykvideos
@sharmafamilykvideos 6 жыл бұрын
Hi , Please tell me how to set and get value from datagrid cell in wpf. Please help me I really need it.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
I'll be covering this in a future video.
@sharmafamilykvideos
@sharmafamilykvideos 6 жыл бұрын
Please make video early
@briansivana
@briansivana 5 жыл бұрын
Fire emojis Tim!!
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Thanks!
@christinamiles
@christinamiles 2 жыл бұрын
Where is the previous lesson that you refer to in this video? I started with Intro to WPF and this was suggested as the next lesson and those steps were not in the Intro I completed watching. Thanks.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Here you go: kzbin.info/www/bejne/opKzd6Rpe82mbs0
@christinamiles
@christinamiles 2 жыл бұрын
@@IAmTimCorey Thank you!!
@danny10846
@danny10846 5 жыл бұрын
Hi Tim, was following this tutorial and got an error when trying to use binding at <a href="#" class="seekto" data-time="450">7:30</a> without having a set part of the FullName variable.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Interesting. Not sure why. You can definitely have a get with no set. If it forced you to, create a set but don't put any code in it.
@danny10846
@danny10846 5 жыл бұрын
@@IAmTimCorey Thanks for the reply, essentially what I ended up doing. Thank you for the amazing tutorials!
@psychedelarte7257
@psychedelarte7257 6 жыл бұрын
thanks for the combox I put :" " instead of if not , I receive this msg :" Items collection must be empty before using ItemsSource." what do you think ? thanks to you
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
In the video I used ComboBox.ItemTemplate (like at 9:00). Did you flip those around or are you referring to somewhere else?
@psychedelarte7257
@psychedelarte7257 6 жыл бұрын
sorry I sorry sorry i didnt saw it thanks for your reply
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
No problem. Glad you got it figured out.
@alam.mahbub
@alam.mahbub 4 жыл бұрын
MediaElement not showing in the output window but showing in Editor window, why? I'm in vs2019
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
In the Output window? Do you mean the application when it is running? If so, the path to your file is probably incorrect.
@alam.mahbub
@alam.mahbub 4 жыл бұрын
​@@IAmTimCorey , i didn't set "copy to output" thats why. Thanks @The Jewel of the Nile for the fix in comments and Thanks ​ ​ @IAmTimCorey , for reply.
@moldovandorin6187
@moldovandorin6187 5 жыл бұрын
What means the dollar sign in the return statement?
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
The dollar sign is used in string interpolation. That is where you insert C# code into a string like "Hello { FirstName }" where FirstName is a variable. The result would be "Hello Tim" when it runs (if Tim was the value of FirstName).
@moldovandorin6187
@moldovandorin6187 5 жыл бұрын
@@IAmTimCorey Thank you for your response. I thought that the brackets would he enough for the interpolation, but they have to be coupled with the dollar sign before the actual string begins.
@RalfsBalodis
@RalfsBalodis 4 жыл бұрын
ok. so I tried out wpf. One thing I tried was to trigger an event that calls a method, that returns a string. Returned string is ment be a image source path. Turns out you can't do it. Method (string) { ImageName.Source ="string". } cannot implicitly convert string to source. Interesting. What do you do with that?
@RalfsBalodis
@RalfsBalodis 4 жыл бұрын
This seems to work. internal static ImageSource GetImage(string imagename) { string path = @$" ...Your path... \Images\{imagename}.bmp"; ImageSource output = new BitmapImage(new Uri(path)); return output; } }
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I am glad you got it to work.
@hellyworld9325
@hellyworld9325 3 жыл бұрын
My Image and Media Elements don't show up when I hit Start and the app runs. They show up in designer but not at run time. Any explanation for this???
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
If you used relative paths, make sure they are being copied over to the output folder. Otherwise they won't be in the same location relative to your application.
@hellyworld9325
@hellyworld9325 3 жыл бұрын
@@IAmTimCorey Ive actually just solved the issue and learned quite a bit in the process. Thanks for the prompt reply!
@Yda93
@Yda93 4 жыл бұрын
Do you have the full course link?
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Here is the link to the full course with the two add-on courses (WPF and MVC): iamtimcorey.com/p/c-application-from-start-to-finish-complete-bundle Here is a link to just the full course: iamtimcorey.com/p/c-application-from-start-to-finish
@testdeftsoft8206
@testdeftsoft8206 6 жыл бұрын
Having an issue unable to view the video on runtime
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
I'm pretty sure this is a problem on your end (Internet filter, connectivity glitch, etc.) since it is viewable on my devices and 979 people have watched it for over 7,000 minutes this month. Try loading it again and seeing what happens. If it doesn't work, I'd say you need to start looking at your PC or network.
@Cookstein2
@Cookstein2 7 жыл бұрын
kzbin.info/www/bejne/Y6uwZWtsp7uips0 would the WrapPanel work in the ScrollViewer as expected if its orientation was set to horizontal?
@IAmTimCorey
@IAmTimCorey 7 жыл бұрын
Yes, if you turn the WrapPanel's orientation to horizontal, it does work with the ScrollViewer. Thanks for pointing that out.
@putinninovacuna8976
@putinninovacuna8976 4 жыл бұрын
moving from flutter to c# let me tell you that flutter is so much better and easier and beautiful interface than c#/xaml but companies and startups doesn't want dart/flutter devs so they force engineers and programmers learn c# .net... I wish xaml was just like flutter... edit: and btw its kinda confusing because rows in flutter are horizontal and columns vertically 😁
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I can see how learning a new language can be difficult. Part of the issue is how new Flutter is relative to C#. As for the rows and columns, they are the same as Flutter. Rows in WPF are horizontal and columns are vertical.
@putinninovacuna8976
@putinninovacuna8976 4 жыл бұрын
@@IAmTimCorey awesome, thanks man I appreciate you answer u should try implement material design to the WPF it's really cool and customizing 👍
@raulblotor9205
@raulblotor9205 4 жыл бұрын
<a href="#" class="seekto" data-time="570">9:30</a>
@stepbystepwithhenry4196
@stepbystepwithhenry4196 5 жыл бұрын
Technicality: Throughout the video, it sounds like you are saying "APF" not "WPF". The sound "Double You' is hard to miss, and it sure sounds like "a' :(
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Bummer.
@kornelijekovac9793
@kornelijekovac9793 4 жыл бұрын
MediaElement doesn't work.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I'm not sure how to help here. It is probably a configuration issue.
@Anomander1
@Anomander1 4 жыл бұрын
They must have named it MediaElement, because you can run movies, music, probably powerpoint and more. If you want video, you have to name the others as well, and that would be a loss in functionality if you ask me.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Yeah. Naming is hard.
@taab84
@taab84 5 жыл бұрын
sorry but i didn't see any complexity in WPF and XAML, it just need some time for adaptation
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
I'm glad you don't find it complicated. Enjoy.
@chezchezchezchez
@chezchezchezchez 4 жыл бұрын
Is this a “tease” for your paid lessons? I’d like to see more advanced WPF tutorials for free from you. WPF has been our for many many years. Why an introduction just now? Aren’t these “a dime a dozen” on KZbin?
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
No, I don't do videos just as a tease for my paid lessons. My paid lessons help fund my free content. I don't hold back in my free content. As for why do a video on WPF controls now, the answer is because it was a popular request. I maintain a suggestion list based upon what people ask for via comments and emails. I then prioritize what I am going to teach partially based upon that suggestion list. As for wanting more advanced WPF videos, have you checked out the WPF playlist I have: kzbin.info/aero/PLLWMQd6PeGY3QEHCmCWaUKNhmFFdIDxE8 It has more content on WPF and MVVM that might be of help. I also use WPF as my desktop application in the TimCo Retail Manager series here on KZbin: kzbin.info/aero/PLLWMQd6PeGY0bEMxObA6dtYXuJOGfxSPx If you are looking for something more specific, let me know and I'll add it to the suggestion list (or upgrade the priority of it a bit if it is already there).
@slowbrain8869
@slowbrain8869 4 жыл бұрын
<a href="#" class="seekto" data-time="390">6:30</a>
@damienk777
@damienk777 7 жыл бұрын
Your avatar is getting creepy tim.
@IAmTimCorey
@IAmTimCorey 7 жыл бұрын
lol, you liked that when I expanded it to full screen? When I was doing my testing, I accidentally expanded it to the full height of my desktop. Since I have four monitors in a 2x2 configuration, that meant that my image got HUGE! That was a bit unnerving.
@henrygene5899
@henrygene5899 5 жыл бұрын
This is TERRIBLE. You do NOT introduce something as BASIC as 'adding items to a drop down list' by introducing a class object collection and a Data Template. You do the '1 step at a time', not 'you need to add 3 things to do this, when a simple example could use 1" Very bad form. If you want to add "Master, Visa, Discover, Amex", you should be able to do this simple example, but this video does not show that basic, simple example.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Well, there are a couple things at play here. First, this isn't the intro video I did previously. Second, this particular case was one that was HIGHLY requested by my audience. Third, this is much more common a scenario than the one you propose. Let's say you have those four items. How do you represent them when capturing the form? As text? That's all you can do since you can't include a key as well without having some type of object. So now you are storing "Discover" in the database every time you say that a person has a Discover card? That's awful for storage space, for lookup speed, and for extensibility. So, if you want to use a dropdown in the real world and not just in a silly demo, you almost always want it to be connected to an object or data set of some type. That's what I demoed so you know how to do it. I don't write code so it works in a test environment. I show you how to write code that you can actually use in the real world.
@henrygene5899
@henrygene5899 5 жыл бұрын
Fair enough, partly. But to the extent that what you just told me is not something that anyone else would know coming in, I think it would be HUGELY BENEFICIAL, if you had a little 'context' up front, telling people something like "I assume that you have already seen the previous, prerequisite video xxx". Then people like me don't make an ass of themselves mistakenly thinking "Ok, this is WPF 101.." Your second point is totally valid, but also addressed by telling people like me (per previous sentence) "As a follow up request...", which again saves me from looking like an ass. And as to your 3rd point: Ok, but again, a Newbie would not know that (unless they make an ass of themselves as I have done here), so SAYING "You might think you would populate this with a simple array but we don't because..." is an extra 30 seconds but - in my defense - this is the kind of honest WHY NOT??? mistakes that people like me make. Thank you VERY MUCH for what you said, I just ask that you bear in mind that to the VERY NEWBIEs who cling to your every word, a little 'ramp up intro/context' would be VERY helpful!! THANK YOU. I apologize for my outburst. I am having a devil of a time wrapping my head around this, and just wish there were a handbook or something that broke this down into basic pieces, and then explained them in context. Your videos are GREAT, can't believe they are FREE., and again, please accept my apologies. Henry
@SteelNight7
@SteelNight7 4 жыл бұрын
@@henrygene5899 He did say that in the video. In the beginning he explicitly states this isn't the first video in the series and this is continuing off his "Intro to WPF" video.
WPF in C# with MVVM using Caliburn Micro
1:23:30
IAmTimCorey
Рет қаралды 362 М.
C#/WPF Building Custom Controls
1:32:20
Kevin Bost
Рет қаралды 20 М.
Son ❤️ #shorts by Leisi Show
00:41
Leisi Show
Рет қаралды 8 МЛН
SPILLED CHOCKY MILK PRANK ON BROTHER 😂 #shorts
00:12
Savage Vlogs
Рет қаралды 8 МЛН
Accessing AppSettings in Console Apps Including Secrets.json
23:53
Advanced C# - LINQ Tutorial
3:07:24
freeCodeCamp.org
Рет қаралды 115 М.
WPF C# Professional Modern Flat UI Tutorial
36:44
Payload
Рет қаралды 804 М.
WPF Controls with MVVM: ItemsControl
33:34
IAmTimCorey
Рет қаралды 83 М.
Alias Any Type in C# 12
9:27
IAmTimCorey
Рет қаралды 4,6 М.
Picking a New MVVM Framework - Moving from Caliburn Micro
1:27:32
IAmTimCorey
Рет қаралды 98 М.
Swift Programming Tutorial for Beginners (Full Tutorial)
3:22:45
CodeWithChris
Рет қаралды 7 МЛН
Son ❤️ #shorts by Leisi Show
00:41
Leisi Show
Рет қаралды 8 МЛН