WPF Controls: Learn basic WPF controls in C#

Поделиться
HTML-код
  • Опубликовано: 13 июн 2024
  • 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

Комментарии • 190

  • @domipetocz
    @domipetocz 3 года назад +12

    Even 3 years later these are the best you can find

  • @RalfsBalodis
    @RalfsBalodis 3 года назад +21

    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

  • @VaderFaderVader
    @VaderFaderVader 7 лет назад +12

    Awesome news about the WPF-port for "From Start To Finish" - can't wait for that one . . .
    Good work so far!

    • @IAmTimCorey
      @IAmTimCorey  7 лет назад +10

      Yep, that one got an overwhelming response. Still trying to figure out how I'm going to do it but it will definitely happen.

  • @Maddy-cy9fu
    @Maddy-cy9fu 5 месяцев назад +1

    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  5 месяцев назад

      I am glad it was helpful.

  • @nickeax
    @nickeax 4 года назад +5

    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 года назад +2

      You are most welcome. Thanks for watching.

  • @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 года назад +1

      I am glad they were so helpful.

  •  5 лет назад +10

    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 лет назад +1

      Excellent! I'm glad these videos are a help.

  • @StreetBladerBloke
    @StreetBladerBloke 7 лет назад +10

    your teaching method is excellent. just waiting your WPF update to your original course....thanks for passing the knowledge

  • @RaviShankar-fq3ex
    @RaviShankar-fq3ex 6 лет назад +2

    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 лет назад +1

      I'm glad this video was helpful.

  • @jairosnyirenda
    @jairosnyirenda 2 года назад

    Wow!!! Just so in love with WPF now... Thank you Tim!!!

  • @Wilhuff
    @Wilhuff 3 года назад +1

    As an old dinosaur doing winforms for almost 20 years, thank you it is a good introduction to WPF. Will switch to WPF soon

  • @rodelioliwag7627
    @rodelioliwag7627 Год назад +1

    Thank you very much. This is very informative

  • @josephmarsh5031
    @josephmarsh5031 6 лет назад +1

    I like the Scroll viewer. thanks for showing these controls! :)

  • @jannickbreunis
    @jannickbreunis 3 года назад

    Really awesome features, good video! Looking forward seeing datagridview-ish controls.. I am hyped seeing only the controls in this videos.

  • @theshubhagrwl
    @theshubhagrwl 6 лет назад

    Thanks a lot for this. This cleared my doubts

  • @panduevank8356
    @panduevank8356 6 лет назад

    This is some amazing teaching skill here.

  • @jennifertran8802
    @jennifertran8802 6 лет назад +1

    Excellent teaching

  • @user-jd1zx
    @user-jd1zx 6 лет назад

    Thank you for sharing these great tuts

  • @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.

  • @farazqureshi3275
    @farazqureshi3275 6 лет назад

    Awesome tutorial
    Please upload more videos of WPF !!!!!!!!!
    please
    Your are great

    • @IAmTimCorey
      @IAmTimCorey  6 лет назад +1

      Thanks! And yes, more WPF videos are coming.

  • @Techie_Nation
    @Techie_Nation 6 лет назад +2

    best tutorials still i have found related WPF !

  • @DaNoob_777
    @DaNoob_777 2 года назад

    Thanks!

  • @barrythorne693
    @barrythorne693 3 года назад

    Brilliant!

  • @LurkerRIP970
    @LurkerRIP970 6 лет назад +5

    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 лет назад +1

      I will definitely be doing another WPF video and these are good topics to be sure are on the list. Thanks for the suggestions.

  • @LGKuyperjr
    @LGKuyperjr 4 года назад

    Great thank you

  • @_.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.

  • @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?

  • @user-tn3bw1wg8w
    @user-tn3bw1wg8w 5 лет назад

    Nice 👍

  • @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.

  • @martinled2151
    @martinled2151 2 года назад

    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

  • @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 года назад +2

      There is a whole playlist for WPF here: ruclips.net/p/PLLWMQd6PeGY3QEHCmCWaUKNhmFFdIDxE8 plus I use WPF in the TimCo Retail Manager series.

  • @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 :)

  • @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

  • @gabesztm
    @gabesztm 4 года назад +1

    MediaElement supports also .mp3 files, so maybe that's why it is not called only VideoElement.
    Thank you for the tutorial!

  • @thejewelofthenile202
    @thejewelofthenile202 6 лет назад +4

    If somebody has a problem with playing video ( 13:15 ) 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".

  • @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.

  • @joshuawaheed
    @joshuawaheed Год назад

    I would be curious to see how to create custom WPF controls from simple to complex.

  • @slowbrain8869
    @slowbrain8869 4 года назад

    6:30 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.

  • @ashwaniyadav3661
    @ashwaniyadav3661 4 года назад +5

    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 года назад +1

      I appreciate the kind words.

  • @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).

  • @bsm9990
    @bsm9990 6 лет назад

    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  6 лет назад

      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 6 лет назад +1

      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 :))

  • @DanaiLuiz
    @DanaiLuiz 5 лет назад +1

    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. 😕

  • @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? ruclips.net/p/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?

  • @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...

  • @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.

  • @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.

  • @TochkaZreniya
    @TochkaZreniya 3 года назад

    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  3 года назад

      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 3 года назад

      @@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.

  • @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.

  • @afgone123456
    @afgone123456 6 лет назад +1

    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

  • @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: ruclips.net/video/LUv20QxXjfw/видео.html

  • @jeremyflowers8908
    @jeremyflowers8908 4 года назад +1

    @21:59 - 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.

  • @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

  • @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 8:39 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

  • @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

  • @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?

  • @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 :)

  • @terjes64
    @terjes64 Год назад

    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.

  • @jorgemora1175
    @jorgemora1175 4 года назад +1

    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  4 года назад

      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 4 года назад

      @@IAmTimCorey thanks, after some time I figure out the use the operator "as" :(combo.selectedItem as Person).FirstName

  • @tomdewilde7956
    @tomdewilde7956 3 года назад

    Notes to myself;
    6:20 : To connect a combobox to a propertie Firstname o/t class "Person"; add
    20:36 : Scrollviewer

  • @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 года назад +1

      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 "*".

  • @briansivana
    @briansivana 5 лет назад

    Fire emojis Tim!!

  • @RalfsBalodis
    @RalfsBalodis 3 года назад

    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 3 года назад

      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  3 года назад

      I am glad you got it to work.

  • @danny10846
    @danny10846 5 лет назад

    Hi Tim, was following this tutorial and got an error when trying to use binding at 7:30 without having a set part of the FullName variable.

    • @IAmTimCorey
      @IAmTimCorey  5 лет назад +1

      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.

  • @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 3:30 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.

  • @alam.mahbub
    @alam.mahbub 3 года назад

    MediaElement not showing in the output window but showing in Editor window, why?
    I'm in vs2019

    • @IAmTimCorey
      @IAmTimCorey  3 года назад

      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 3 года назад

      ​@@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.

  • @christinamiles
    @christinamiles Год назад

    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  Год назад

      Here you go: ruclips.net/video/laPFq3Fhs8k/видео.html

    • @christinamiles
      @christinamiles Год назад

      @@IAmTimCorey Thank you!!

  • @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.

  • @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.

  • @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

  • @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 года назад +1

      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!

  • @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 лет назад +1

      I do explain that in some videos but I don't in all of them. One class per file. That's the best practice.

  • @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.

  • @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.

  • @raulblotor9205
    @raulblotor9205 3 года назад

    9:30

  • @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' :(

  • @Cookstein2
    @Cookstein2 7 лет назад

    ruclips.net/video/-zM486rVopk/видео.html
    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 года назад +1

      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 👍

  • @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.

  • @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.

  • @kornelijekovac9793
    @kornelijekovac9793 4 года назад

    MediaElement doesn't work.

    • @IAmTimCorey
      @IAmTimCorey  4 года назад

      I'm not sure how to help here. It is probably a configuration issue.

  • @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 RUclips?

    • @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: ruclips.net/p/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 RUclips: ruclips.net/p/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 года назад

    6:30

  • @damienk777
    @damienk777 7 лет назад

    Your avatar is getting creepy tim.

    • @IAmTimCorey
      @IAmTimCorey  7 лет назад +2

      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.