Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. WPF TabControl Events

WPF TabControl Events

Scheduled Pinned Locked Moved WPF
wpfcsharpdatabasedesignarchitecture
27 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Pete OHanlon

    Tom Delany wrote:

    Create a ResourceDictionary under Application.Resources

    Typically, you create an external ResourceDictionary file and then reference it in your App.Xaml (in the ResourceDictionary section). This would look something like this:

    <Application.Resources>
    <ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="AppResources.xaml" />
    </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
    </Application.Resources>

    Forgive your enemies - it messes with their heads

    "Mind bleach! Send me mind bleach!" - Nagy Vilmos

    My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

    T Offline
    T Offline
    Tom Delany
    wrote on last edited by
    #21

    Thanks Pete. I'm still struggling with how to make the TabControl use the templates the way he suggested above. I created the ITabItem interface, and the ObservableCollection of ITabItems as he suggested. I bound the TabControl ItemSource to the ITabItem ObservableCollection (which is the collection of ViewModels). I figured out how to create a DataTemplate for each ViewModel as per Collin's suggestion. I think I could figure out how to bind one specific DataTemplate to the TabControl ItemTemplate, but I have multiple DataTemplates... Obviously I can't bind the Dictionary to the ItemTemplate. :sigh: :confused: Problem is, I can't even seem to come up with the right combination of words to Google for...

    WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

    P 1 Reply Last reply
    0
    • T Tom Delany

      Thanks Pete. I'm still struggling with how to make the TabControl use the templates the way he suggested above. I created the ITabItem interface, and the ObservableCollection of ITabItems as he suggested. I bound the TabControl ItemSource to the ITabItem ObservableCollection (which is the collection of ViewModels). I figured out how to create a DataTemplate for each ViewModel as per Collin's suggestion. I think I could figure out how to bind one specific DataTemplate to the TabControl ItemTemplate, but I have multiple DataTemplates... Obviously I can't bind the Dictionary to the ItemTemplate. :sigh: :confused: Problem is, I can't even seem to come up with the right combination of words to Google for...

      WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #22

      If you take a look at my article here[^], you should be able to see how I hooked up the DataTemplate elements to the TreeView for different ViewModels. Hopefully that should help.

      Forgive your enemies - it messes with their heads

      "Mind bleach! Send me mind bleach!" - Nagy Vilmos

      My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

      T 1 Reply Last reply
      0
      • P Pete OHanlon

        If you take a look at my article here[^], you should be able to see how I hooked up the DataTemplate elements to the TreeView for different ViewModels. Hopefully that should help.

        Forgive your enemies - it messes with their heads

        "Mind bleach! Send me mind bleach!" - Nagy Vilmos

        My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

        T Offline
        T Offline
        Tom Delany
        wrote on last edited by
        #23

        Thanks Pete. I'll take a look at it. Sorry about the stupid questions. After rereading the MSDN documentation about DataTemplates, and your suggestion about the ResourceDictionary (and removing the x:Key elements from my data templates :doh:) I got it to actually sort of work. The DataTemplate documentation finally keyed me in on the fact that the way Collin was suggesting I do the templates using "DataType" would cause the DataTemplate to be "magically" applied for that type. That was what I was not seeing in my mind... Now if I can just figure out how to make the tabs look like tabs again with headers at the top... :sigh: Always something with WPF...

        WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

        P 1 Reply Last reply
        0
        • T Tom Delany

          Thanks Pete. I'll take a look at it. Sorry about the stupid questions. After rereading the MSDN documentation about DataTemplates, and your suggestion about the ResourceDictionary (and removing the x:Key elements from my data templates :doh:) I got it to actually sort of work. The DataTemplate documentation finally keyed me in on the fact that the way Collin was suggesting I do the templates using "DataType" would cause the DataTemplate to be "magically" applied for that type. That was what I was not seeing in my mind... Now if I can just figure out how to make the tabs look like tabs again with headers at the top... :sigh: Always something with WPF...

          WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #24

          Tom - they aren't stupid questions, they are just questions about doing something differently. You have to remember that declarative programming is a lot different to the world of traditional coding; getting your head around it isn't easy, and a lot of very smart people have spent a lot of time figuring how to get this all to hang together. I've read articles by these smart people. :-D

          Forgive your enemies - it messes with their heads

          "Mind bleach! Send me mind bleach!" - Nagy Vilmos

          My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

          T 1 Reply Last reply
          0
          • P Pete OHanlon

            Tom - they aren't stupid questions, they are just questions about doing something differently. You have to remember that declarative programming is a lot different to the world of traditional coding; getting your head around it isn't easy, and a lot of very smart people have spent a lot of time figuring how to get this all to hang together. I've read articles by these smart people. :-D

            Forgive your enemies - it messes with their heads

            "Mind bleach! Send me mind bleach!" - Nagy Vilmos

            My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

            T Offline
            T Offline
            Tom Delany
            wrote on last edited by
            #25

            I've been reading articles lately until my head hurts. They just don't seem to soak in. I feel like you and those other smart people are in a class way above me...

            WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

            1 Reply Last reply
            0
            • T Tom Delany

              Thanks Collin. Clear as mud. ;) Actually, I think I understand what you mean. A couple of things I feel a little fuzzy about, but I think I have enough info. to sort it out. If I run up against something I can't figure out, hopefully you won't mind if I bug you again. :-O

              WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #26

              Hope you got everything straightend out. I was out of the office yesturday so not hitting up CP much. Nothing 'silly' or 'dumb' about your questions. The only true 'dumb' question here on CP is when someone makes no effeort and asks "plz will u gimme codez" Otherwise you will find a lot of support. In fact the CP community is what got me up and running and for that I come back often and return the favor (and still get to be set straight :) ) WPF/Silverlight does have a strong learning curve so don't feel like you are alone. Most of the people answering the questions also struggled with it, but are just a couple years ahead of the game. Take bennefit from it and ask so you do not make the same mistakes the early birds did :-D

              Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

              T 1 Reply Last reply
              0
              • L Lost User

                Hope you got everything straightend out. I was out of the office yesturday so not hitting up CP much. Nothing 'silly' or 'dumb' about your questions. The only true 'dumb' question here on CP is when someone makes no effeort and asks "plz will u gimme codez" Otherwise you will find a lot of support. In fact the CP community is what got me up and running and for that I come back often and return the favor (and still get to be set straight :) ) WPF/Silverlight does have a strong learning curve so don't feel like you are alone. Most of the people answering the questions also struggled with it, but are just a couple years ahead of the game. Take bennefit from it and ask so you do not make the same mistakes the early birds did :-D

                Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

                T Offline
                T Offline
                Tom Delany
                wrote on last edited by
                #27

                Not really... :^) http://www.codeproject.com/Messages/4126589/UserControl-as-a-TabItem.aspx[^]

                WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups