caliburn

Caliburn Launch without App.xaml, but with bootstrapper

感情迁移 提交于 2021-02-19 03:36:21
问题 I have a WinForms project from which I want to open a WPF window from a WPF user control project. But when I create an instance of the WPF window and call Show(), the bootstrapper isn't loaded. In an Windows Application, it's located in the App.xaml, but an user control project doesn't have this. What can I do? Thanks! 回答1: The only thing accomplished by having the bootstrapper in App.xaml's resources is instantiation of the bootstrapper and keeping a reference so it isn't garbage-collected.

Can I use Caliburn to bind to RoutedCommands?

不想你离开。 提交于 2020-01-02 08:01:50
问题 What's the best way to use WPF's built-in RoutedCommands with Caliburn? For example, in my shell I have an Edit menu with a Copy item in it attached to the standard command found in ApplicationCommands : <Menu> <MenuItem Header="Edit"> <MenuItem Header="Copy" Command="ApplicationCommands.Copy" /> </MenuItem> </Menu> I want this item to be handled by a TextBox when it has the focus and by my own controls when they have the focus. In my controls I can handle Execute and CanExecute in code

Binding SelectionChanged to ViewModel using Caliburn.Micro

回眸只為那壹抹淺笑 提交于 2019-12-31 20:18:28
问题 We've using Caliburn.Micro on a new Silverlight project and everythings working great. The inbuilt conventions bind buttons click events to the viewModel, but I'm not sure what the best way to handle the selectionChanged event on datagrids and comboboxes is. At the moment, I'm binding to the selected item and calling custom logic, but I feel like this is a bit of a code smell and that I should seperate the setting of the property and the selectedChange event. But if I seperate these, how do I

Binding SelectionChanged to ViewModel using Caliburn.Micro

有些话、适合烂在心里 提交于 2019-12-31 20:18:11
问题 We've using Caliburn.Micro on a new Silverlight project and everythings working great. The inbuilt conventions bind buttons click events to the viewModel, but I'm not sure what the best way to handle the selectionChanged event on datagrids and comboboxes is. At the moment, I'm binding to the selected item and calling custom logic, but I feel like this is a bit of a code smell and that I should seperate the setting of the property and the selectedChange event. But if I seperate these, how do I

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

MissingMethodException - Caliburn

十年热恋 提交于 2019-12-24 13:09:52
问题 I have created a program that uses plugins using Caliburn and .NET 4. When creating an instance of the plugin, a container, window manager, and a view-model factory is injected using caliburn's abilities. However, when a code containing usage of one of the injected properties is run, I get a MissingMethodException . It is driving me crazy. Also, if the plugin instance has dependencies that need to be satisfied (like IContainer, and IWindowManager) which are registered by default in Caliburn,

Caliburn - Exception handling and Rescue

我怕爱的太早我们不能终老 提交于 2019-12-23 20:17:42
问题 I'm using C# and Caliburn. Is there a global way to catch all exceptions in all view models? What about when there is some kind of exception during import from a DI/IoC container? I basically want to display a message box when this occurs. The RescueAttribute looks to me like it would have to be put on every single view model class, and it doesn't seem like it works when you use AsyncActionAttribute at the same time. 回答1: The method IConventionManager.ApplyActionCreationConventions(IAction

Add multiple views inside a view using WPF and Caliburn.Micro

江枫思渺然 提交于 2019-12-18 10:44:42
问题 I'm trying to learn using Caliburn.Micro with WPF. How can I add multiple views inside a view? <Window x:Class="ProjectName.Views.MainView" ...> <Grid> <views:MyControlView /> </Grid> </Window> Another view, with viewmodel: MyControlViewModel <UserControl x:Class="ProjectName.Views.MyControlView" ...> <Grid> ... </Grid> </UserControl> If i just add the view, it won't detect that it has a viewmodel with the appropriate name. How can i bind this to it? I have tried out with different

Clean separation of UI with Caliburn MVVM

时间秒杀一切 提交于 2019-12-11 16:41:13
问题 Looking into various MVVM frameworks for SL. In the Caliburn documentation I saw a code in a controller that calls MessageBox. Is this right or is this just for intro? Is there something like MessageBox service in Caliburn like in Chinch MVVM? 回答1: It's indeed introductive code, just to demonstrate that the controller method is actually executed. Yet, I agree on the issue you pointed out: the presence of raw UI code in the presenter could lead to an inappropriate mix of view concerns. About

Binding View and ViewModel on a DataGrid

泪湿孤枕 提交于 2019-12-11 08:47:27
问题 I'm using a View and ViewModel set on an already existing ViewModel. You could say that's the base with the second ViewModel placed on that. When placing another ViewModel in the underlying ViewModel of MainViewModel ( BrowseViewModel in this particular sample), the associated ViewModel does not show up. Implementation as follows: class MainViewModel : PropertyChangedBase { private BrowseViewModel _BrowseViewModel= new BrowseViewModel(); public BrowseViewModel BrowseViewModel { get { return