prism

Prism RequestNavigate does not work

╄→гoц情女王★ 提交于 2019-12-18 16:46:14
问题 In each view public partial class View2 : UserControl, IRegionMemberLifetime, INavigationAware { public bool KeepAlive { get { return false; } } bool INavigationAware.IsNavigationTarget(NavigationContext navigationContext) { return true; } void INavigationAware.OnNavigatedFrom(NavigationContext navigationContext) { // Intentionally not implemented. } void INavigationAware.OnNavigatedTo(NavigationContext navigationContext) { this.navigationJournal = navigationContext.NavigationService.Journal;

How do I test Prism event aggregator subscriptions, on the UIThread?

一笑奈何 提交于 2019-12-18 13:07:26
问题 I have a class, that subscribes to an event via PRISMs event aggregator. As it is somewhat hard to mock the event aggregator as noted here, I just instantiate a real one and pass it to the system under test. In my test I then publish the event via that aggregator and then check how my system under test reacts to it. Since the event will be raised by a FileSystemWatcher during production, I want to make use of the automatic dispatch by subscribing on the UIThread, so I can update my UI once

MEF: a replacement for PRISM?

懵懂的女人 提交于 2019-12-18 10:53:19
问题 To what extent, if any, is MEF a replacement for PRISM? 回答1: Edit: Do not read this answer. It is embarrassingly wrong. I am fail. Read Glenn Block's below. It's not obvious, but this is the same question: Managed Extensibility Framework (MEF) vs. Composite UI Application Block (CAB) Consensus in the duplicate post is that MEF and Prism provide the same basic set of functionality in different ways, except that Prism provides the Event Aggregator, which is a pub-sub means of communication

Prism - Cross Region DataBinding

喜欢而已 提交于 2019-12-18 09:32:45
问题 Lets say i have 2 regions A and B. Region A: <Grid> <TextBlock Name="tba"> HAHAHA </TextBlock> </Grid> Region B: <Grid> <TextBlock Text="{Binding ElementName=tba, Path=Text}"/> </Grid> This does not work. What is the workaround to fix this, so in region B also "HAHAHA" is displayed ? 回答1: Your view models can communicate with each other to make the connection via EventAggregator . // needs to be public if the two view models live in different assemblies internal class ThePropertyChangedEvent

Referencing the correct System.Windows.Interactivity dll from Prism application

限于喜欢 提交于 2019-12-18 04:00:15
问题 I have a WPF Prism application that I'm building. The application is to the point where I want to be able to add EventTriggers to controls so I can call commands on the underlying view model. However, I can't seem to reference the correct DLLs to make the project run. Currently, I'm referencing Microsoft.Expression.Interactions and System.Windows.Interactivity from the C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\.NETFramework\v4.0\Libraries directory. When I run the module, I get

MVVM: Modified model, how to correctly update ViewModel and View?

你离开我真会死。 提交于 2019-12-17 21:53:23
问题 Case Say I have a Person class, a PersonViewModel and a PersonView . Updating properties from PersonView to the Person model is simple enough. PersonViewModel contains a Person object and has public properties the PersonView binds to in order to update the Person model. However. Imagine the Person model can get updated by Service . Now the property change needs to be communicated to the PersonViewModel and then to the PersonView . This is how I would fix it: For each property on the Person

How to make MouseOver event in MVVM?

混江龙づ霸主 提交于 2019-12-17 20:29:08
问题 I use the following code to navigate on button click: XAML: <Button x:Name ="Btn_Import" Grid.Row="33" Grid.Column="15" Grid.ColumnSpan="36" Grid.RowSpan="36" Command="{Binding NavigateCommand}" CommandParameter="ViewImportProgress"/> ViewModel: public DelegateCommand<string> NavigateCommand { get; set; } public MainButtonsViewModel(IRegionManager regionManager, IMainMenuTooltipViewer mainMenuTooltipViewer) { NavigateCommand = new DelegateCommand<string>(Navigate); } private void Navigate

Binding between my usercontrol and ViewModel

假装没事ソ 提交于 2019-12-17 19:56:38
问题 Can not do Binding Random (MyViewModel) -> VMTestValue (MyViewModel) -> TestUserControl (MainWindow) "MyViewModel" is ViewModel for "MainWindow" All project: http://rusfolder.com/32608140 TestUserControl.xaml <UserControl x:Class="TestBinding.TestUserControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com

WPF, Prism v2, Region in a modal dialog, add region in code behind

∥☆過路亽.° 提交于 2019-12-17 18:55:26
问题 I have a composite WPF application. In one of my modules I want to make a wizard and have the steps show up in a region so I can switch between the steps easier. Originally I had this wizard showing up in a tab region and the nested region worked fine. Now I want to make it into a modal dialog box, but after I open it the inner region never gets registared with the region manager; So I can't add my wizard steps. I was under the impression that the region manager was global, and just adding

How to do multiple shells in my Prism app (like MS Office)?

房东的猫 提交于 2019-12-17 17:34:35
问题 I try to create an application that has a window behaviour as MS Office, for example Word/Excel. The user opens the application and when clicking new, a completely new window shall appear with the look of the application. The closest that I found so far is this: Link However, here the shells are shown at application start. How to do this by command, or maybe there is a completely different way to achieve this? Edit: I have also found the following now: Link, but where and how to call this