Reputation: 5781
I have MainPaqe.cs
(MainPaqe.xaml
) and Periodic_Request.cs
(Periodic_Request.xaml
), in addition, Periodic_Request.xaml
has TextBox
with name TxtBlock_numRequest
and Combobox
with name CmbBox_lvlPriority
with possible 3 options.
The problem is how get user written numbers or strings from TextBox
and Combobox
in the MainPaqe.cs
. I need to get all this information after pressing button
.
Someone has advised to use MVVM
, but honestly I can`t understand it. This is why I need your help.
Upvotes: 0
Views: 87
Reputation:
MVVM
is an architectural design pattern which facilitates the Separation of Concerns
design pattern. It is highly advantageous to make use of the MVVM
pattern when developing your WPF
applications although not compulsory. Implementing the MVVM
pattern in your application can require a little more effort and thought, at least when first using it, than is required when using WPF
the old WinForms
code-behind
way.
1) If you want to go down the
MVVM
route, take a look at theEventAggregator
andMediator\Message Bus
patterns. These allowclasses
to communicate with one another without them requiring direct knowledge of one another.2) Alternatively if you are happy to continue using the
WinForms
route, take a look at theEventHandler<T>
delegate. This will allow you to raise anevent
in oneclass
which can be detected by anotherclass
.
Upvotes: 1