caliburn.micro

Screens shared in multiple screens disappear after deactivation in Caliburn.Micro

别说谁变了你拦得住时间么 提交于 2019-12-24 15:13:06
问题 I've run across an issue using Caliburn.Micro when sharing a Screen between multiple parent Screens. In this example I have 2 tabs inside a shell. Each tab shares a single instance of SharedViewModel (essentially a singleton). var shared = new SharedViewModel(); Items.AddRange(new [] { new TabViewModel { Shared = shared }, new TabViewModel { Shared = shared }, }); And each tab's view has a ContentControl bound to the Shared property which is SharedViewModel : <ContentControl cal:View.Model="

Application running itself on a separate desktop

旧时模样 提交于 2019-12-24 12:26:27
问题 Trying to create a WPF caliburn micro application that creates a separate desktop and shows its main window there. Problem: after the desktop is created and i switch there, no window is shown. namespace WpfThreads { class AppBootstrapper : Bootstrapper<WpfThreads.ViewModels.WpfThreadsViewModel> { protected override void OnStartup(object sender, StartupEventArgs e) { var desktop = Native.CreateDesktop("NewDesktop", 0, 0, 0, DESKTOP_READOBJECTS | DESKTOP_CREATEWINDOW | DESKTOP_CREATEMENU |

Combine dependency properties

 ̄綄美尐妖づ 提交于 2019-12-24 11:14:33
问题 I've done a few WPF projects now and see the same problem pop up and that is the "problem" of aggregating/combining dependency properties (dp's). For example, I have 10 dp's of type bool that I want to combine and expose as a seperated dp. The combined dp is true unless one or more its constituents is false. I currently do this using the addValueChanged which registers a callback for each of the 10 (!() dp's but am wondering if there are more elegant solutions or maybe a framework that

Combine dependency properties

拟墨画扇 提交于 2019-12-24 11:13:50
问题 I've done a few WPF projects now and see the same problem pop up and that is the "problem" of aggregating/combining dependency properties (dp's). For example, I have 10 dp's of type bool that I want to combine and expose as a seperated dp. The combined dp is true unless one or more its constituents is false. I currently do this using the addValueChanged which registers a callback for each of the 10 (!() dp's but am wondering if there are more elegant solutions or maybe a framework that

Caliburn.Micro Conductor: Trigger/Action firing more than exptected

拥有回忆 提交于 2019-12-24 06:58:08
问题 I'm trying to put together a very simple example app, but it is not working as intented. Here is the scenario: Caliburn.Micro, MVVM, Silverlight 5.0 - simple Conductor example from https://caliburnmicro.codeplex.com/wikipage?title=Screens%2c%20Conductors%20and%20Composition&referringTitle=Documentation (Simple Navigation) I just put together a live example: https://db.tt/kTIjKvRx -> hit enter in textbox (messagebox displays 1x) -> go to master and go back to login -> hit enter in textbox

NullReferenceException on DisplayRootViewFor<> [duplicate]

拟墨画扇 提交于 2019-12-24 06:51:35
问题 This question already has answers here : What is a NullReferenceException, and how do I fix it? (29 answers) Closed 2 years ago . I've created a class derived from BootstrapperBase , overwrote OnStartup() and call DisplayRootViewFor<AppViewModel>() just like in the documentation. But when i start the app, i get a NullReferenceException on DisplayRooViewFor<AppViewModel>() using Caliburn.Micro; using MHBRestore.Logic; using MHBRestore.UI.ViewModel; using System; using System.Collections

Exception/MessageBox in Calibur.Micro

北战南征 提交于 2019-12-24 05:54:40
问题 I start learning Caliburn.Micro and I am little confuse of handling with exception/messange box in view model class. I found some blogs about, for example: http://frankmao.com/2010/11/18/handling-messagebox-in-caliburn-micro/ For example some method in view model class which can produce exception. public void MethodWichCanProduceEx(string arg1, string arg2 ) { if(arg1==null) throw new ArgumentNullException("arg1 is null"); if (arg2 == null) throw new ArgumentNullException("arg2 is null"); try

RadMenu and RadMenuItem Caliburn.Micro

六眼飞鱼酱① 提交于 2019-12-24 00:33:33
问题 I load programatically a radMenu with no problems using Caliburn.Micro, the Xaml looks like this: <telerik:RadMenu ItemsSource="{Binding .MenuItems}" VerticalAlignment="Top" cal:Action.TargetWithoutContext="{Binding RelativeSource={RelativeSource Self}}" cal:Message.Attach="[Event ItemClick] = [Action MenuItemClick($this)]"> <telerik:RadMenu.ItemContainerStyle> <Style TargetType="telerik:RadMenuItem"> <Setter Property="Tag" Value="{Binding .Tag}" /> <Setter Property="Header" Value="{Binding

Caliburn.Micro EventAggregator

别来无恙 提交于 2019-12-23 18:20:31
问题 Apologise if this a really stupid question but I'm just getting started with caliburn.micro and I'm struggling with getting the eventAggregator, nothing seems to be subscribing... I'm not sure whether the problem is with the view model or the bootstrapper. Here is the viewmodel: class MainWindowViewModel : Screen { private readonly IEventAggregator _eventAggregator; public MainWindowViewModel(IEventAggregator eventAggregator) { _eventAggregator = eventAggregator; _eventAggregator.Subscribe

Intercept Ninject instance activation?

这一生的挚爱 提交于 2019-12-23 17:37:17
问题 I'm trying to put an example together of using Caliburn Micro on WP7 with Ninject. Everything was pretty straight forward. However, I'm stuck on how to go about firing an event once an instance is Activated by Ninject. Here is the ActivateInstance method in Caliburn Micro's SimpleContainer, the IoC container that comes with CM for the phone. protected virtual object ActivateInstance(Type type, object[] args) { var instance = args.Length > 0 ? Activator.CreateInstance(type, args) : Activator