caliburn.micro

Caliburn.Micro: Binding Button in a Screen to a command in ScreenConductor

血红的双手。 提交于 2019-12-05 08:53:46
问题 I'm following this tutorial on Screen and ScreenConductors in Caliburn.Micro Framework. I'm using WPF, not Silverlight, and I have made the corresponding changes in App.xaml (using MergedDictionary for the Bootstrapper). The original Simple Navigation example has a shell with two buttons, and a content area where two possible screens are displayed, conducted by the ShellViewModel . Then I tried to move each button to its counterpart View, so that PageOne would have a button to take to PageTwo

Can anybody provide any simple working example of the Conductor<T>.Collection.AllActive usage?

别等时光非礼了梦想. 提交于 2019-12-05 07:57:19
It's a bit strange, but I really can't find a working example anywhere. By the way, I'm using a ViewModel-first approach (in WPF) if this is important. Thank you in advance. If you have a look at the discussion here you will see that the intent of AllActive is to compose several Views/ViewModels into a containing ViewModel. Judging from your previous comments it seems as if this is what you were expecting but I figured I'd at least reference it here. You then mention activating 3 different ViewModels at different regions of the View. The way I've handled this in the past is to have separate

Getting row information after a doubleclick

牧云@^-^@ 提交于 2019-12-05 02:16:43
I am trying to retrieve row info from a datagrid after a double click event. I have the event setup, but now I just need to setup the function to retrieve the data from the row. XAML: <DataGrid Width="Auto" SelectionMode="Extended" IsReadOnly="True" Name="ListDataGrid" AutoGenerateColumns="False" ItemsSource="{Binding ListFieldObject.MoviesList}" DataContext="{StaticResource MovieAppViewModel}" cal:Message.Attach="[Event MouseDoubleClick] = [Action RowSelect()]"> <DataGrid.Columns> <DataGridTextColumn Width="200" IsReadOnly="True" Header="Title" Binding="{Binding Title}"/> <DataGridTextColumn

Caliburn Micro cancel window close from ViewModel

我怕爱的太早我们不能终老 提交于 2019-12-05 00:02:22
When the user clicks the close button of a Window, is it possible to cancel the close from the ViewModel or do I have to resort to code behind? From what I can tell, CanClose or TryClose doesn't do the trick. You may have already tried this but I've just created a quick test, deriving a view model from Screen and overriding CanClose. public class ShellViewModel : Screen { public override void CanClose(Action<bool> callback) { //if(some logic...) callback(false); // will cancel close } } 来源: https://stackoverflow.com/questions/8790526/caliburn-micro-cancel-window-close-from-viewmodel

Using MessageBinder.SpecialValues in Windows 8 app not working?

孤街醉人 提交于 2019-12-04 16:50:20
I'm brand new to Caliburn.Micro, so I'm hoping somebody might be able to help me here :). I'm trying to use MessageBinder.SpecialValues in my Windows 8 app, but I can't get it to work. I'm adding a new "$pointerPercentage" to know the percentage (float between 0.0 and 1.0) of how far the mouse is positioned within an element (for a music keyboard in my synthesizer app). Everything else is currently working (so I believe I have Caliburn.Micro wired up properly). I've added the following to the Configure method of my App.xaml.cs: protected override void Configure() { container = new

Dynamic menus with Caliburn micro

余生长醉 提交于 2019-12-04 13:49:14
I use Caliburn micro for my WPF Project. Static menus are easy to bind with Caliburn <Menu Grid.Row="0" IsMainMenu="True"> <MenuItem Header="_File"> <MenuItem x:Name="OpenScript" Header="_Open script"/> </MenuItem> <MenuItem Header="_Script"> <MenuItem x:Name="RunScript" Header="_Run script" /> <MenuItem x:Name="StopScript" Header="_Stop script" /> </MenuItem> <MenuItem Header="S_ettings"> <MenuItem x:Name="Plugins" Header="_Plugins">...Clickable children here</MenuItem> </MenuItem> </Menu> The names are bound to methods on the model, but for the Plugins menu that you see above we need to bind

Caliburn Micro: DialogResult

谁说我不能喝 提交于 2019-12-04 13:34:45
问题 I can't find a solution for the following problem: I open a Dialog with the WindowManager from caliburn micro: public void UserNew() { this._windowManager.ShowDialog(new UserViewModel(this._windowManager)); } Now I need a DialogResult when the user close the dialog with the OK button. The ShowDialog method of WindowManager don't return a DialogResult... Can anyone help me? 回答1: I tend to use the View Model to handle determining what happened in the dialog. For instance, you can have an

Caliburn.Micro + MEF + Modern UI: IContent events

独自空忆成欢 提交于 2019-12-04 13:26:18
问题 I've started a project using Caliburn.Micro and Modern UI (https://mui.codeplex.com) and am having some difficulty getting the navigation events of IContent to fire on my view model. I've already got the two hooked up to work with each other with the following: CM Bootstrapper: public class CMBootstrapper : Bootstrapper<IShell> { private CompositionContainer container; private DirectoryCatalog catalog; public CMBootstrapper() { } protected override void Configure() { catalog = new

WPF Caliburn.Micro/mvvm Navigation

我只是一个虾纸丫 提交于 2019-12-04 11:58:16
问题 I'm building a project, and one of the biggest problems I've come across until now is navigation. I've been looking for some time now for examples of caliburn.micro/mvvm navigation, but they all seem to be really long and I couldn't really understand much of it (beginner here!). Some info about my project: I want there to be an outer window/shell, with menu links/tabs that open pages according to the button clicked inside an inner part of the shell, and be able to open change the page from

Caliburn.Micro + Autofac bootstrapping

对着背影说爱祢 提交于 2019-12-04 11:05:24
I have a project with Caliburn.Micro, and I'm trying to port from its SimpleContainer to Autofac . I'm using this code , that is an updated version of the code in this guide . Using SimpleContainer I simply did (inside the bootstrapper) protected override void OnStartup(object sender, System.Windows.StartupEventArgs e) { this.DisplayRootViewFor<IScreen>(); // where ShellViewModel : Screen } Now this doesn't work anymore, so what should I do to integrate Autofac with Caliburn.Micro ? There are a couple of things wrong with your solution. Firstly, nothing invokes your AppBootstrapper . This is