caliburn.micro

Bind Selected Item to comboBox with caliburn micro

 ̄綄美尐妖づ 提交于 2019-12-13 00:17:26
问题 I have seen and tested a lot of material about this and I have the problem again. I have a collection of cities bound to the combobox and I want to set the selected item (selected city) when I click the button (for simplicity) this is my combobox in xaml: <ComboBox Grid.Column="1" HorizontalAlignment="Left" Margin="65,10,0,0" Height="25" Name="Cities" DisplayMemberPath="Name" IsSynchronizedWithCurrentItem="True" VerticalAlignment="Top" Width="71"> </ComboBox> this is code in corresponding

Show one child VM, then show another, after the first was closed

核能气质少年 提交于 2019-12-12 20:24:00
问题 I have one parent conductor. I want to show first view-model inside it. Then after first one is closed (i.e. some operation is done), I want to show a different view-model. I'm using Caliburn.Micro.Contrib, where a ConductResult displays child VM in a Conductor . It has a cool extension method AfterClosingDo , which runs a coroutine after that child was deactivated and closed. However, when I run another ConductResult using AfterClosingDo , basically this happens: first child VM is closed

send selected item as parameter to method in view-model [WPF,Caliburn]

不问归期 提交于 2019-12-12 18:22:41
问题 I have this problem. I use caliburn micro in WPF. In view I have listbox, and I bind on event MouseDoubleClick method in view-model. I would like send as parameter selected listbox item. But I don’t know how do it. in view I have this: <ListBox Name="Friends" SelectedItem="Key" Style="{DynamicResource friendsListStyle}" Grid.Row="2" Margin="4,4,4,4" Micro:Message.Attach="[MouseDoubleClick]=[Action SendRp(Key)]" PreviewMouseRightButtonUp="ListBox_PreviewMouseRightButtonUp"

Hooking into a Storyboard.Complete event with MVVM pattern

走远了吗. 提交于 2019-12-12 09:57:29
问题 Basically, what I've got is a simple alert message setup. There is a view for the individual alerts with some data-binding to the VM for their text and color (green for success, red for error, etc.). <Border Margin="0 0 0 20" Background="{Binding Path=BackgroundColor}" BorderBrush="#D4D4D4" BorderThickness="1" CornerRadius="8"> <Border.Effect> <DropShadowEffect Color="DarkGray"/> </Border.Effect> <Grid > <Button Content="X" HorizontalAlignment="Left" Margin="268,10,0,0" VerticalAlignment="Top

Caliburn Micro cancel window close from ViewModel

限于喜欢 提交于 2019-12-12 09:33:24
问题 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. 回答1: 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 } }

Caliburn.Micro HelloWindowManager Sample - View location not working

ぃ、小莉子 提交于 2019-12-12 06:58:58
问题 The HelloWindowManager Caliburn.Micro sample demonstrates displaying a Window (View) as Modal, Modeless or Popup and works just fine. However it has the views and Viewmodels in the project root so I wanted to tidy it up and have it use the default convention for view and view model locations, so I made the following changes: Created a Views folder and moved both the ShellView.xaml and DialogView.xaml within it Created a ViewModels folder and moved the matching View Models Adjusted the

Generated files by caliburn.micro in Release directory

谁说我不能喝 提交于 2019-12-12 06:34:21
问题 Caliburn.Micro generates a lot of files in my Release directory. Do I need to include them all while distributing package with my application? Is it possible to disable copying those files? Caliburn.Micro.Platform.xml Caliburn.Micro.xml directories like de, en, es etc. with a single file: System.Windows.Interactivity.resources.dll These *.xml files look like meta-data for Caliburn. My application will only support English, so maybe I could remove other directories, but I'm not sure if

How to use MainWindow as ShellViewModel View?

邮差的信 提交于 2019-12-12 03:14:58
问题 I understand that by default CM will look for ShellView in Views folder to use as ShellViewModel View but I want to use the MainWindow instead... can this be done and how? 回答1: How it Works CM uses a set of View/ViewModel Naming Conventions, generally speaking, if you have a ViewModel named FooViewModel CM will attempt to locate a type with a similar name of FooView or FooPage . What if you really want "MainWindow" and "ShellViewModel"? If you just wanted to use an existing "MainWindow" with

How to request a permission from a different view?

女生的网名这么多〃 提交于 2019-12-12 03:09:09
问题 I have a Project which contains three views: A MainView, which contains the two other views. The two sub-views contain Lists of Objects (Let's call them View A and B), which are largely independent. But sometimes there is a connection between the objects, which are contained in the Lists. Since the dawn of time, only Objects from List A "knew" about objects of Type B, Type B has no Idea that A could exist. This was intended behaviour and would be difficult to change. But know I have a Problem

Add a usercontrol to caliburm micro dynamically

一曲冷凌霜 提交于 2019-12-12 02:43:57
问题 I am using Caliburn Micro with WPF. I want to create an application with a menu on the left side, and a grid on the right side of the application. When clicking on a menu item, the grid on the right side, will change to another view. The another view will be in a separate file. MainWindowView: <UserControl x:Class="CMDemo.Views.MainWindowView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas