Git Product home page Git Product logo

Comments (11)

GeertvanHorrik avatar GeertvanHorrik commented on May 18, 2024

Comment created by @GeertvanHorrik:

No, posting it here is preferred. Jira provides much better workflow handling and much more than codeplex does.

from catel.

GeertvanHorrik avatar GeertvanHorrik commented on May 18, 2024

Comment created by @GeertvanHorrik:

I can reproduce the behavior in your app. Now trying to see why it happens.

from catel.

GeertvanHorrik avatar GeertvanHorrik commented on May 18, 2024

Comment created by @GeertvanHorrik:

It's strange that the actual DataContext of the SettingsWindow is the view model. The DataContext should remain nothing, the inner grid datacontext should be the SettingsViewModel. Maybe it has to do with the fact that these are data templates. Still figuring out.

from catel.

GeertvanHorrik avatar GeertvanHorrik commented on May 18, 2024

Comment created by @GeertvanHorrik:

Yes, that is the issue. They are DataTemplates and are selected based on their datacontext. The SelectedItem is the CurrentViewModel which then works a bit different.

It is best to simply create 2 tabs with different views and let the views take care of the view model construction.

from catel.

GeertvanHorrik avatar GeertvanHorrik commented on May 18, 2024

Comment created by @GeertvanHorrik:

To fix this, please use the following steps:

  1. Clear all code-behind in MainWindowViewModel

  2. Change your MainWindow xaml to:

     <TabControl >
         <TabItem Header="{Binding RelativeSource={RelativeSource Self}, Path=Content.ViewModel.Title}">
             <views:HomeWindow />
         </TabItem>
    
         <TabItem Header="{Binding RelativeSource={RelativeSource Self}, Path=Content.ViewModel.Title}">
             <views:SettingsWindow />
         </TabItem>
     </TabControl>
    

from catel.

GeertvanHorrik avatar GeertvanHorrik commented on May 18, 2024

Comment created by ericyu:

Do you meaning this case has been fixed?
Actually, I have same issue. My case is first tab is list data, when i click one of this list, program should create new tab with selected item data, since tab item added base on click, I can't pre-set tabitem.
Could you give me some suggestion?

Environment:
.NET 4.0, VS2010, Catel 3.9

from catel.

GeertvanHorrik avatar GeertvanHorrik commented on May 18, 2024

Comment created by @GeertvanHorrik:

It was a bug in the user code. Try using the 2 hints I gave in my last comment.

from catel.

GeertvanHorrik avatar GeertvanHorrik commented on May 18, 2024

Comment created by ericyu:

beside this option, any another idea?
I would like locate viewmodel first then get view,
it looks you release view everytime when I switch to another tabitem, but when switch back new view lost binding.

from catel.

GeertvanHorrik avatar GeertvanHorrik commented on May 18, 2024

Comment created by @GeertvanHorrik:

The TabControl provided by Catel (see Catel.Extensions.Controls) has several different options to control the behavior. If you think you found a bug in the latest prerelease (note we fixed a lot from 3.90 => current state), please provide a repro.

from catel.

GeertvanHorrik avatar GeertvanHorrik commented on May 18, 2024

Issue was closed with resolution "Fixed"

from catel.

lock avatar lock commented on May 18, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from catel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.