Answer the question
In order to leave comments, you need to log in
How to understand the development of a desktop application?
For a long time I could not formulate my question and its details.
For example, let's take a website. By clicking on the controls, we can navigate through its various sections. That is, the browser loads different pages each time, but all actions take place in one window.
Now let's take a desktop application. For example Skype. By clicking on the contact list, the right side of the application opens the chat, but the left side (the contact list) remains in its place.
In general, how is this implemented and with the help of what?) Yes, most likely, I formulated my thought stupidly, but still I ask for help from knowledgeable people.
PS While surfing Google, I came across the MVVM pattern. Am I heading in the right direction?
Answer the question
In order to leave comments, you need to log in
Window.Resources>
<DataTemplate x:Key="MainWindow" DataType="{x:Type viewModels:MergedModuleManagerViewModel}">
<ns:MainWindowView/>
</DataTemplate>
<DataTemplate x:Key="OpenProject" DataType="{x:Type viewModels:MergedModuleManagerViewModel}">
<ns:OpenProjectView/>
</DataTemplate>
</Window.Resources>
<Grid>
<ContentControl>
<ContentControl.Style>
<Style TargetType="{x:Type ContentControl}">
<Setter Property="ContentTemplate" Value="{DynamicResource MainWindow}" />
<Style.Triggers>
<DataTrigger Binding="{Binding SwitchView}" Value="1">
<Setter Property="ContentTemplate" Value="{DynamicResource MainWindow}" />
</DataTrigger>
<DataTrigger Binding="{Binding SwitchView}" Value="2">
<Setter Property="ContentTemplate" Value="{DynamicResource OpenProject}" />
</DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>
</ContentControl>
</Grid>
You can implement it however you want, using MVVM or not, it's just a matter of approach.
The essence of a desktop application is that you have a window and controls on it. You load some data into them. In your example, on the left is the list of contacts, which is loaded first and then can change (for example, if a new contact is added). On the right, you display other controls, the data in which changes as you work with the application.
Click on a contact - triggered some event - triggered some code that loaded data into some object - this data was transferred to the controls on the right.
In the MVVM model, all the internals are hidden, you just set the event, update the data (model), and the rendering takes place by itself, the essence, however, does not change.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question