A
A
Amffore2017-10-25 15:19:47
WPF
Amffore, 2017-10-25 15:19:47

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

4 answer(s)
O
Oblfakir, 2017-10-25
@Oblfakir

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>

For example, this way you can replace one component with another, respectively, the SwitchView value changes from the code - and the displayed component changes accordingly. In some parts of the application, I made it simpler, but not very beautiful - I controlled the visibility of specific components, i.e. they are located in one place, and we see only one specific one.
Used by MVVM, ViewModel must implement INotifyPropertyChanged interface

G
Griboks, 2017-10-25
@Griboks

You take the textbook on OOP and read.

P
Ptolemy_master, 2017-10-25
@Ptolemy_master

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.

V
Viktor, 2017-10-26
@Levhav

Approximately the same way as spa applications are made.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question