prism

How to clear text box on click in MVVM

℡╲_俬逩灬. 提交于 2019-12-31 03:03:07
问题 I have a textbox and a button I want to clear the contents of textbox on button click. I am using MVVM prism. My XAML is <TextBox Grid.Row="0" Text="{Binding Path=TextProperty,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}" Name="txtUserEntry2"/> <Button Content="Select" Command="{Binding Path=MyCommand}" /> and In my View Model public string TextProperty { get { return selectedText; } set { selectedText = value; SetProperty(ref selectedText, value); } } //////......... private void

Differences between WPF Custom Control Library and plain Class Library?

拈花ヽ惹草 提交于 2019-12-30 09:42:36
问题 I posted a question a few months ago about sharing resource dictionaries across assemblies. It turns out you can do that using the Component Resource Key markup extension. At the time, I could only get it working with a WPF Custom Control project, not with a plain Class Library project. Now I need to use an existing plain Class Library project to host a shared resource dictionary. That means I need to retrofit the Class Library project to support the Component Resource Key markup extension. I

Differences between WPF Custom Control Library and plain Class Library?

早过忘川 提交于 2019-12-30 09:41:07
问题 I posted a question a few months ago about sharing resource dictionaries across assemblies. It turns out you can do that using the Component Resource Key markup extension. At the time, I could only get it working with a WPF Custom Control project, not with a plain Class Library project. Now I need to use an existing plain Class Library project to host a shared resource dictionary. That means I need to retrofit the Class Library project to support the Component Resource Key markup extension. I

WPF tab control and MVVM selection

别等时光非礼了梦想. 提交于 2019-12-30 00:52:48
问题 I have a TabControl in an MVVM WPF application. It is defined as follows. <TabControl Style="{StaticResource PortfolioSelectionTabControl}" SelectedItem="{Binding SelectedParameterTab}" > <TabItem Header="Trades" Style="{StaticResource PortfolioSelectionTabItem}"> <ContentControl Margin="0,10,0,5" Name="NSDetailTradeRegion" cal:RegionManager.RegionName="NSDetailTradeRegion" /> </TabItem> <TabItem Header="Ccy Rates" Style="{StaticResource PortfolioSelectionTabItem}"> <ContentControl Margin="0

Alternatives to Prism + MEF for modular MVVM apps [closed]

末鹿安然 提交于 2019-12-29 03:10:51
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . My team and I are beginning to plan the development of a modular application which will likely multi-target WPF & Silverlight. I

How to Unit Test DelegateCommand that calls async methods in MVVM

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-28 13:24:10
问题 I am new to Unit Testing MVVM and using PRISM on my project. I am implementing Unit Testing on our current project and not having luck finding resources online that would tell me how totest DelegateCommand that calls async method. This is a follow up question to my post - How to Unit Test a ViewModel with async method. on how to unit test an async methods in MVVM and was answered that public methods can be tested using async TestMethod. This scenario will work only if the method that I want

How to Unit Test DelegateCommand that calls async methods in MVVM

≯℡__Kan透↙ 提交于 2019-12-28 13:22:03
问题 I am new to Unit Testing MVVM and using PRISM on my project. I am implementing Unit Testing on our current project and not having luck finding resources online that would tell me how totest DelegateCommand that calls async method. This is a follow up question to my post - How to Unit Test a ViewModel with async method. on how to unit test an async methods in MVVM and was answered that public methods can be tested using async TestMethod. This scenario will work only if the method that I want

Prism assembly reference failure: System.Windows.Interactivity

☆樱花仙子☆ 提交于 2019-12-28 04:09:25
问题 I have C#/WPF Prism (v4.0) app that has a persistent problem loading/resolving the System.Windows.Interactivity dll that comes with the Prism library. I've been working for three days straight trying to debug/solve this problem. I've learned a ton about .Net assembly resolution, but no luck so far on my problem, so I thought I'd turn to the StackOverflow community in a desperate plea for help. :) I have a module running as part of a larger Prism app, which needs to reference System.Windows

Keep the collections in the list in MVVM

陌路散爱 提交于 2019-12-25 16:44:38
问题 currently im having troubles in keeping the collections in the list in the mvvm, every time that i navigate away and return to a page, the list keeps getting empty. how am i going to deal with this? can someone help me with this? The Model: I have not implemented the others yet because i cant add items to the list class CartData { public int Cakeprice { get; set; } public ImageSource ImagePath { get; set; } public string Caketype { get; set; } public string Cakename { get; set; } public int

Have a module dependent Injection for State in PRISM WPF application

此生再无相见时 提交于 2019-12-25 16:00:40
问题 hi we have a PRISM WPF MVP application, we would like to have a state to share data between the views in the same module. Since PRISM by default doesnt have a state, was wondering if there is any way i could implement this. Presently i have injected a State with Dictionary as back-store, but the problem is its Global i.e available across the modules. i would really like to scope this injection being module specific. I believe unity allows registering different classes to the same interface