WPF Controls with MVVM: ComboBox

Поделиться
HTML-код
  • Опубликовано: 7 фев 2025

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

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

    I'm Japanese and I'm not very good at English.
    Thanks for the explanation of MVVM.
    It's a gentle narrative, and the automatic RUclips translation works well.
    I was struggling with the lack of material on Caliburn.Micro, but the video helped me out. It is.

  •  6 лет назад

    Thanks Tim, it's help me a lot to understand how fun is to learn WPF!

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

    Really looking video about datagridview and Dataset. :D. You are the best Tim.

  • @colin-campbell
    @colin-campbell 6 лет назад

    Oh god I’ve been so looking forward to a toolbox overview!
    I’m such a nerd...

  • @RalfsBalodis
    @RalfsBalodis 4 года назад +2

    0:00 - Intro
    1:17 - Prerequisite
    2:04 - Demo app overview
    8:14 - ComBobox: creating, data binding and data displaying
    11:44 - Binding with Caliburn Micro
    13:41 - Data Template: StackPanel
    16:13 - Selected item: Display data
    20:40 - Selected item: Display data dropdown (nested data)
    23:49 - Selected item: Displaying data from nested dropdown
    32:24 - Summary
    34:51 - Concluding remarks

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

    Great video, I use my own MVVM Framework. MVVM saves a lot of time when it closes to the ComboBox. I almost never set my Items in XAML, I almost always use DataContext and ItemsSource.

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

    That's been very useful video. Thank you
    Next Datagrid please.

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

    Yesss!! I've been looking forward to this video!
    DataGrid next, pretty please?

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

    Tim, you rock! I'm working on a WPF app where I believe I have to use a grid for dynamically added controls (textboxes and checkboxes) and data grid to store the data entered in those controls. When I say "dynamically added" I mean a situation when user can add another row of textboxes and checkboxes to the window by clicking "Add row" or "+" button. That'd be very helpful if you could shed some light on the aspects of creating something like that.

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

      I believe I already have that scenario covered in an upcoming WPF video in this series. Thanks for the suggestion.

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

      Looking forward to watching it! Thank you!

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

    Thanks Tim! Great video as always.

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

    Tim: long time viewer first time poster. I love your channel and the quality of the videos you put out. The fact that you're able to release videos so quickly at this quality is amazing! You originally turned me on to Caliburn.Micro with your video from 2017. I was a bit surprised when you were able to use POCO items to feed a BindableCollection. I was always under the impression that my data classes had to implement NotifyOfPropertyChange on their members as full properties. Did I miss something fundamental in the Caliburn.Micro documentation? Since my app uses tabs I'm using CM from a Bootstrapper class. Does this make any difference? I can't see why it would. BTW, I think you should get 5% of my future software sales - your tutorials have been an amazing help!

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

      The NotifyOfPropertyChange is baked into the CM libraries. Also, the BindableCollection also fires off notifications when items change.

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

    Ha, @25:55 was exactly what I was doing, with my quest for answers leading here. Ended up binding SelectedItem to a property and calling methods from its setter (MvvmCross).

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

    Very Clear and Understandable ...

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

    Hi Tim! Good tutorials as usual! Can you please put all of your wpf material in its own playlist? :)

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

      That is coming soon. Thanks for the suggestion.

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

    Tim, thanks again. I learned a lot. I did read some of the FCL documentation to get up to speed with what binding really meant and learn more about some of the tags we used like combobox, listbox, DataTemplate etc. I did run into a question: and did not give me the same result. I think you said x:Name and SelectedItem are similar or the same. When I used SelectedItem={Binding ...} method I did not get any addresses.

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

      Combo Boxes are a bit different. You bind the list and then you bind the selected item instead of just binding the Text on a TextBox.

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

      @@IAmTimCorey Thanks. One more question please. Is there a name for closing method vs. self-closing and what is the difference in terms of when we use one vs. the other please?

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

    19:00 thanks for the caliber-micro thing

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

    Hi Tim, first of all thank you for your content. I´ve been watching your videos and they are very helpful. Now, I´ve followed this method you show on this video and all works well. I have 2 combo boxes, the first with the manufactor of a product and the second with brands of that manufactor. So when i choose the manufactor on the first combo box, the second Combobox only shows their brands. That works great! Now the problem is that I pré-populate the Selected Items. So what i would expect is that when i load the data both combo boxes should show the correspondent information. Well, the first combo box works fine, it shows the manufactor, but the second one is always empty. One thing i´ve noticed, after debugging, was that the property of the Selected Item for the Brand is populated before the combo boxes are loaded on screen, but right after they show up the Selected Item turns null. It´s been days trying solving this issue. Can you, or someone here, help me with this?
    I am also using Caliburn Micro but instead of WTF I´m using UWP.
    Thank you so much!

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

      I'm wondering if the event that triggers the second combo box to be filled is getting fired when the Manufacturer combo box has the selected item filled. You might need to suspend that event if you are in the process of loading (like creating a variable called IsLoading that is set to true before the data gets populated and is set to false only after everything is loaded. Then only fire an event if the IsLoading is false.)

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

    i love your videos so much please keep going

  • @nilomartinezjr4108
    @nilomartinezjr4108 3 месяца назад

    I do not know if it useful to mention this now. But regarding the SelectedPerson.Address not binding the issue is that the List Addresses is a sub object of SelectedPerson and the object Full address is an address of Addresses. Therefore the XAML x:Name="SelectedPerson_Addresses_FullAddress" would work as it did for me. You were making a reference to the List Addresses, instead of the object/property FullAddress that belongs to it.

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

    Hi Tim,
    first of all many thanks for all your effort you put into the videos. I have never followed such a well-explained series of learning videos.
    I have a quick question which most likely is easy to answer for you. How would a binding look like if you would like to place a combobox twice, both refering to the same property? I know that it somehow must work with doing a manual binding. That's how you already explained it for textblocks. But how would you do this for a combobox?
    Thanks for your help. Keep you publishing new videos :-).

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

      The concept is basically the same. Instead of name binding, you manually bind the data to your property.

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

    Good tutorial as always. Can you do one more how to bind enum to combobox a still be able to save to DB as int and display in combobox as display name of enum. What is the best practice ? Thank you.

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

      I will add it to the list. Thanks for the suggestion.

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

    Hi! i have a question a bit outside the scope of this video, but is very related. In the constructor of ShellViewModel (7:05) you called a method (da.GetPeople()) for getting a BindableCollection of People from a DataAccess object (da). If there were a chance that this method threw an exception, what would be the best way to handle it? A Try Catch block inside the constructor? As always, thank you so much for your excelent videos!

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

    Question:
    I have a list of people extracted from my own database in my comboBox listed in my program however, when I click on a name in the comboBox let's say "John Doe" or "James Deen", every time I do that the ComboBox shows me nothing. An empty box. Does not display their name. How can I make it so that when I select a name it sticks to the name instead of giving me an empty box?
    Really love your content. Very informative.

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

      Does the technique I showed you in this video not work? It should show you the name like it did for me.

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

      @@IAmTimCorey Well, my project is different from the one on your video. What I did so far was write a database on SQL Server, create my WPF form, created a ComboBox and inside my ComboBox I typed in a method that would take the SQL data set from SQL Server and populate it into the ComboBox. I also wrote a code that pushed any new entry into the SQL database and update the ComboBox with the updated data. Is there a way I can share to you what I've got? I'd post it here but I'm a very private person lol.

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

    Tim, at 16:54 you are typing in variable name _selectedPerson and when you hit the tab key it changes to the suggested variable name personModel, is there a way to get it to accept the variable name you are typing in and not the suggested name when you hit the tab key? It looks like you got it to work the first time at 28:48 when you typed in _selectedAddress. I've been trying to figure this out ever since I saw this video for the first time and I've searched all over the internet and cannot find a solution.

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

    I have enjoyed your videos, they have been a great help. How would you "unselect" or "reset" a selected item in a combobox? In other words, the equivalent of doing selected index equals to negative one? Any help would be greatly appreciated.

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

      Change the property value in the ViewModel.

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

    Hi Tim, thanks for another great video. Maybe it is not the right place for these questions, I apologize for that, but I have two and I couldn't find a better place :).
    First, I need to learn more about the "organisation" of an application, how to design models, view and so on, I'm kind of new to MVVM. Do you have any course you could recommend to me? Is "Tournament Tracker Add-on: WPF with MVVM User Interface" the right one for this?
    And second, do you have any video or any blog talking about the power of C# vs VB in .NET? I have googled a lot but in most of the cases it seems that there are not great differences. I would like to have more arguments about that.
    Many thanks.
    Matías.

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

      The Tournament Tracker Add-on course that covers WPF will show you a practical example of MVVM in action. On this channel, I have a playlist of WPF videos, most of which use or explain MVVM. Those two options in combination will be a good way to learn MVVM.
      As for C# vs VB.NET, I don't have a video on it but here are the basics: VB.NET was created to transition VB6 developers over to the .NET platform (I was one of them). It was a stepping stone. The primary focus of Microsoft, and of the world in general, is on C#. So while VB.NET continues to tag along, it isn't as good of a solution simply because of support. If you search for an example of something on the Internet, the example will be in C# 99 times out of 100. If you watch a tutorial, it will almost certainly be in C#. Even Microsoft's documentation tends to only add on VB.NET occasionally. So while VB.NET was a great way for VB6 developers to ease into .NET development, it isn't a great option for your long-term language.

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

    Is it ok to put code behind the view to deal with events? click, keydown etc.
    I was trying to filter the items inside my combobox using events (like keydown), but then I found a better way using only NotifyOnPropertyChanged and a new Property to hold user input.

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

      If you are using MVVM then you want to put your filter code in the ViewModel and then bind to the keydown event (or whatever you want) to trigger the filter (if that is even necessary - I doubt it is since you can just filter based upon the property and since it changes, the filter changes).

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

    Hi Tim,
    I really appreciate your videos, learned alot from you. I would like to ask you if we can bind in the same way the Content property of a CheckBox.
    will work?

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

      Yep. I'm not 100% on the syntax (thank goodness for Intellisense) but the concept is correct.

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

    gr8 video!

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

    Please make on with datagrid with itemssourcre and has a total row and a title of the table.

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

      These types of scenarios will be covered in future videos in this series.

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

    Very nice, thanks

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

    Hi Tim, thanks for the video. It is informative even almost a 1 year ago.
    I have question regarding the 'Models' folder.
    Is the WPFDemoUI's 'Models' folder compulsory(due to naming convention) or even useful if compared to DemoLibrary's 'Models' folder?
    To me, it seems it is replacable by DemoLibrary's 'Models' folder.
    Compared to 'Views' and 'ViewModels' folder which have strong relationship, WPFDemoUI's 'Models' folder seems can be called from other Library Class.

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

      Yes, the Models folder should remain in the UI. It isn't technically needed for MVVM but it should be there. The issue is that Models in your library can be useful until you need to add UI elements to them (decorators such as Required or MinLength, etc.) Then you need to have your Models in your UI that are close to what you have in your library. I came across this issue in the TimCo Retail Manager series.

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

    Tim, why do you never call NotifyOfPropertyChange in setter of BindableCollection? Is it something related to the fact that this thing implements INotifyPropertyChanged interface?

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

      BindableCollection has the notifications built in.

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

    @18:01 Should the Notify not happen after the set? LOL: Just before 20:22 it got you!

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

      Yep, I usually forget that at least once.

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

    Hi Tim - thank you for yet another great video!
    Out of the box, I've got an error 'The name "Bootstrapper" does not exist in the namespace "clr-namespace:WPFDemoUI" '
    on the line
    of App.xaml
    Reinstalling Caliburn Micro, restarting Visual Studio did not help. Any ideas?

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

      Did you create the Bootstrapper class? Also, did you use the version of Caliburn Micro I did? Later versions changed some things.

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

      @@IAmTimCorey re-building the WPFDemoUI project solved the issue for me.
      I am using Caliburn.Micro v3.2.0 - works like a charm on this and preceding WPF video-tutorial projects )

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

    Hello Tim I'm wondering why did you update the People BindableCollection by putting it in a constructor? I know other times you use just properties with backing fields and use NotifyOfPropertyChange. Sorry I'm totally new to MVVM and Caliburn and I'm having a hard time understanding this stuff

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

      I'm not sure what you mean by updating it in the constructor. Can you explain a bit more about what you are asking about?

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

      ​@@IAmTimCorey I'm sorry I should have been more specific. However, I think I understand now. Am I correct when I say that BindableCollection kind of does the same thing as NotifyOfPropertyChange?

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

    Thank you !))

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

    How could we change the SelectedItem from the back code? On your example we do not want the the user to have to click the Addresses Combobox to select the first result. The first or default address for that Person Model should be preselected by the code.

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

      When you populate the list in the VM, take the first value and put it in the property that serves as the selected item.

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

    hi and thanks for the tutorial.
    im curious about how we store the SelectedItem and Show it to the console, thanks and god bless you.

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

      We are putting the SelectedItem into the SelectedPerson object. Then, when we want to get the value for SelectedItem, we just look in the SelectedPerson object (line 18 at 18:16).

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

    How should I implementent the change of text in the TextBlock if the CheckBox will be checked?
    Let's say TextBlock is displaying the selection of the combobox, but after checking the checkbox, the TextBlock text will change to any other property of the SelectedPerson.
    I am really struggling with this.

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

      Maybe instead of trying to change the binding of a TextBox, you could have two TextBoxes that occupy the same space. Hide or show each based upon the value of the Checkbox. Then it appears as though the box changes bindings but it is actually two different boxes.

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

    i need a comboox filter while typing and using to select arrows in wpf c#

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

    Out Of The Box: Will you release the course on Xamarin Form as well here on RUclips?

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

      The course will only be on IAmTimCorey.com but I will release videos on Xamarin Forms on this channel.

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

      @@IAmTimCorey That means a lot, thank you so much!

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

    Hi Tim, I'm Trying to use this knowledge to do my own script with interface to PowerSehell, but i have some problem to show what i have in combobox concatenated in a txtblock, do you know anything about?

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

      Not sure what you are trying to do, sorry. I do have a video on how to work with PowerShell in C# coming soon (about a month or so).

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

    Is there a way to offset the string a bit to the right once it is selected from the dropdown?

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

      Yep, although I don't have an example to show you.

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

    Hello Tim is there a way I change the ComboBox behavior to not capture mouse? Every time the dropdown is open and I try to click something outside the Checkbox/dropdown, it closes the dropdown and prevents the clicked control from receiving the mouse click!

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

      Interesting question. You could put something in the click action for the cell around the checkbox that toggles the checkbox when clicked (so the whole cell acts like the checkbox).

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

    Hi tim, great job, how can do this without caliburn lib... thanks!

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

      Nothing that does, simply implement the Notify class and voila, great job tim, I follow closely your tutorials and tips.

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

      You can do binding without Caliburn Micro. It just isn't as easy.

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

    Hi Tim,
    How do you display comboBox name?
    I would be nice to "see" what comboBox holds, especially when there is more of them on a form.
    So lets say that I want to see a "People" on a comboBox.
    I know I can solve a problem by putting a textBlock saying "People" in front of a comboBox filled with people, but what about having a both things on same box? :)
    Thanks for tutorial, great content!!!

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

      Not sure what you mean by both on one box.

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

      @@IAmTimCorey Well when I start the application I would like to see "People" on a comboBox so that the user knows what that comboBox holds. So that is not an item in a comboBox just an initial value set on comboBox.

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

      OK, got it. You can do something like that by building it as a custom control (which is fairly easy in WPF).

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

    Hi Tim, you set the binding by ItemsSource="{Binding pathName}" (or by x:Name="propertyName), but I can't figure out, how the binding source is set... I would be pleased, if you could explain the mechanisms behind different ways of defining the binding source (and binding path). And as I mentioned in another comment, it would be so great, if you could do a video on implementing all these binding examples in code behind, just to understand what really is going on under-the-hood. At the moment I'm working my ass of, trying to understand the binding mechanisms, but I already lost the overview. Especially binding a DataGrid with different kinds of columns, setting up in code behind doesn't work as I want to have it. So that would be awesome. Thanks for your efforts.

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

      I can see what I can do. Basically, these are wired up by Caliburn Micro directly. Further explanation will come in a future video, if I can fit it in somewhere.

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

      @@IAmTimCorey that would be awesome.

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

    And here goes another one, hope you dont mind. What if i want that method da.GetPeople() to be async? Let say i need that data there when the windows load, and it comes from a API. I saw a bit of a debate on the internet regarding to this. I tried Stephen Cleary's library Async.ex in order to do Asynchronous Initialization but the nuget package didnt work, maybe i should try again. But besides that i would really like to know your opinion about this topic. Thanks!

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

      In this case, we are doing sample data access so there is no need for async (actually, it would be a bad thing since it would add overhead without adding any benefits). However, when you are doing real data access, you would make that call asynchronous. For example, Dapper has the option to make calls async. So QueryAsync instead of Query.

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

    I have a question, how to change the color of a control (Backgroud) in WPF and control the color in c# code (in xaml I know how to do it)?

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

      Xaml: cs: myButton.Background = new SolidColorBrush(Colors.Red); make sure you have: using System.Windows.Media; namespace

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

    I did everything just like in your movie. When binding data to the name People, I have the warning No DataContext found for Binding People. I looked through all the code again, but combo box is still empty.

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

    Thanks a lot.

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

    Hello Sir,
    wound you please tell me How can I achieve Auto suggest kind of functionality in Combobox. I tried IsEditable=true, Readonly=false. If I type 'Jo' in combobox drop down, list of names containing Jo like Joe Rege, Regan Joe, Jordan have to appear from list of bound data. Thanks much

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

      The simplest thing would probably to have an event fire when the user starts typing. The event could filter the list based upon what is typed.

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

    how can a product lookup work in datagrid mvvm using caliburn when click a cell in datagrid a lookup opens for product to pick and add it back to datagrid and show its price i have a form where i want this to work but i am unable to do it can u do a video on such task

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

      I will add it to the list. Thanks for the suggestion.

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

    Why do we sometimes write {Binding ...} and sometimes {Binding Path="..."}? What is the difference?

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

      There are slight differences: stackoverflow.com/questions/5488014/are-binding-path-and-binding-really-equal

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

    How are you binding your textblock to display value selected in comboBox?

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

      It has been a while but I believe I'm binding the TextBlock to the SelectedItem from the ComboBox.

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

    How do I make it do IoT with full batteries and More powerful class.

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

      That's really not in the scope of this channel yet.

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

    Can you make a video Visual Studio Windows Form on saving and loading multiple Comboboxes whatever the user selects in each combobox they can click a button to save to a specific location and have a load button to find the exact file and it will populate each combobox they changed.

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

      Been searching for a few days now.

    • @tomthelestaff-iamtimcorey7597
      @tomthelestaff-iamtimcorey7597 3 года назад

      That is pretty specific and unique. Tim strives to teach viewers broad skills that are adaptable in a multitude of situations. It is unlikely he will attempt to resolve you specific project.

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

      @@tomthelestaff-iamtimcorey7597 k.

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

    Pls suggest me how to bind combobox value with tables values and print in console with select combobox value

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

      I'm not sure what you mean by binding a combo box with table values. If you mean from a database, that is essentially what we are doing here. I don't like the concept of directly tying it to the database table, because that leaves open a connection, ties you tightly to the database, and generally ignores any layering in your application. As for printing to the console, we don't really have a console in WPF. You can technically do it but only a developer can see it. This video shows you how to get the selected value, though, so you should be able to put the rest of the pieces together.

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

    how to list the selected item in the data grid .. instead in the text box?

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

      I have a video on how to work with the datagrid here: ruclips.net/video/zvyQNuuTqks/видео.html

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

    hy Tim, in other video you used Mode=OneWayToSource. But here you don't. Why?

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

      Because in that video I wanted updates to flow one way. In this video I wanted them to go both ways.

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

    I can't download the code. Thanks for your video

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

      Send me an email at tim@iamtimcorey.com and let me know which one is giving you an issue. Also, check your spam folder.

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

    Hi Tim,
    I love your videos, and learnt alot from your stuff.
    I have a Question regarding image source binding from string path (the image is stored in image folder of my project as resource)
    However, when i apply the source binding, it ends up showing nothing!
    Below is the code provided..
    code (xaml):

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

      In code, it would look something like this: screenImage.Source = new BitmapImage(new Uri(imageFiles[currentImage], UriKind.Absolute));
      In a binding, it would look more like this: stackoverflow.com/a/2068983/733798

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

    Whats a public static superdooper class mean? Bc that's what mine says. Must be a better version I paid $10,000 dollars for my laptop so its heaps better than everybody else's.
    How do I get into the code section of this laptop?

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

      Maybe you should stay tuned for my Foundation in C# video that is coming out soon. It sounds like you need to start at the beginning of C#. This video is definitely not the place to start. Join my mailing list so you hear when the Foundation in C# course modules are released.

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

      I'm just talking smack bro. This video is just what the Dr ordered. I've been trying to figure out the simplest method of setting ItemsPanelTemplate of a ListView using either DataTemplateSelector, VisualStateManager or a click event +='d on a void. Hoping to find all the answers in this video.

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

    How does the Person know which Addresses are associated with it, where is the link?

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

      In this demo, we add AddressModel class objects to the PersonModel class directly. So the PersonModel contains the associated AddressModels associated with it.

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

    Warning to anyone testing out combo boxes: when you're using NotifyOfPropertyChange, make sure you're pointing to the property and not the underlying field.
    Making that mistake is... painful.

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

    Whats a data?

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

      Data is any information you want to store or show. Like name, email address, etc.

  • @RafaelSantos-hg7jh
    @RafaelSantos-hg7jh 6 лет назад

    Still entreprise projects with WPF ?

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

      You can use WPF with enterprise projects, but you can also use them for small personal projects or anything in between.

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

      Actually, Visual Studio was built with Visual Studio in WPF for the UI. The only HTML in it that I'm aware of is the start page. Discord was built with Electron so it is JavaScript/HTML/CSS.

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

      Oh, sorry, I misread that. Yep, VSCode is written in Electron for cross platform compatibility.

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

    MVVM?

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

      Correct. MVVM is a user interface design pattern that allows us to separate our displays from our data (like MVC in ASP.NET). It allows us to create less form-specific code so that it is easier for us to replace a form down the road without rewriting our UI code (data binding, event handlers, etc.)

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

    Hi Tim, I came back to this video hoping to find an answer to the question how to bind an object which has numerical values for some properties, but for the user those numerical values need to be converted in readable text in the View. I would like to use enums with descriptions (see eg: stackoverflow.com/questions/2650080/how-to-get-c-sharp-enum-description-from-value) in my 'DemoLibrary'. What if the IsAlive property of the Person model had not been of type Boolean but of type Integer and we had an enum like this:
    public enum IsAliveOrDead
    {
    [Description("This person is alive")]
    Alive = 1,
    [Description("This person has died.")]
    Dead = 2,
    [Description("It is unknown if this person is alive")]
    Unknown = 3
    }
    I would like to store the numerical value in the database, but show the description in the View. There are a lot websites trying to cover this topic, but so far I have not come across an example that uses caliburn micro and mvvm and more importantly is as clear as your videos typically are. Perhaps you could consider to cover this topic in a future video.

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

      I can definitely add that to the suggestion list.

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

    Hi Tim,
    I back to this video to find out how you populate addresses for person. My question is how would you do that with dapper? But, not for only one person, how you will get all persons and get all addresses for them? I found this article on web (section: A parent object with its child objects) www.tritac.com/blog/dappernet-by-example/
    I would like to see your solution.
    I couldn't test this code because I couldn't find this lookup.TryGetValue(). I install System.Linq package but still I don't get this method.
    Maybe you can make some advance video about Dapper.
    Thanks.

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

      I have some advanced Dapper videos coming soon that should answer your question.

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

      @@IAmTimCorey
      Hi Tim, Thanks for your answer. Never enough new subjects. In mean time I found WPF Dialogs that can be very interesting for new video. I found few examples on RUclips but no one explain what and why they are doing.
      Thanks.

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

    a havea problem with ActivateItem ---doesnt exist

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

      You are probably using the 4.x version of the NuGet package for Caliburn Micro instead of a 3.x version. In 4.x, they made all of the calls Async (so ActivateItemAsync exists). It will change how the code works, though, so unless you feel confident in knowing how to translate what I do to async, just roll your version of Caliburn Micro back to the latest 3.x version and you will be fine.

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

    Great videos BUT have videos WITHOUT 3rd party references, like C.M, first. 😮‍💨

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

      Thanks for the suggestion.

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

      Why? That is the most infuriating thing about WPF. Why do I have to implement an object with INotifyPropertyChanged? WTF? Why do I need to implement ICommand? This should be part of the standard library. Millions of programmers have to implement these stupid objects first. They will not get it on the first try and there will be no tests for it. What a waste of time!

  • @im1in260m
    @im1in260m 5 месяцев назад

    I would have liked this without using 3rd party MVVM tool.

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

    But WPF is still used nowadays?

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

      People still use COBOL. Why wouldn't they use WPF? Plus Microsoft is working on .Net Core 3.0 which will have applications in WPF and Windows Forms (yes, people still use Windows Forms).

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

      Correct. WPF is the top-tier desktop application from Microsoft unless you are able to do UWP applications (most organizations are not because of the operating system requirements). Actually, the most common desktop user interface in businesses still seems to be WinForms because they just work and they are easy. Microsoft has committed to supporting WPF and WinForms for a long time into the future.