caliburn.micro

Current value displayed in ComboBox

℡╲_俬逩灬. 提交于 2019-12-12 00:15:49
问题 I can't seem to get the current selected value to show in the ComboBox when the items in the ComboBox are custom objects from the database. I put together the following test ViewModel and View. SimpleWidgets and ObjectWidgets behave as expected. CodeWidgets (list retrieved from the database as custom 'Code' objects) never displays the SelectedCodeWidget. public class TestViewModel:BaseTabViewModel { private List<int> simpleWidgets; public List<int> SimpleWidgets { get { return simpleWidgets;

Removing UserControl code behind for use with MVVM

谁说我不能喝 提交于 2019-12-11 23:23:00
问题 I am trying to create a user control using MVVM. Basically I am trying to wrap a combobox that will pull data from a respository. This will allow me to use the same combobox in many different views in my application. There will be many of the wrapped comboboxes throughout the application. I was easily able to create this control using a DependencyProperty and code-behind. I am now trying to convert this to MVVM and am having trouble figuring out how to get the value back to /from the

WPF Ribbon Fluent:DropDownButton + Caliburn.Micro event

a 夏天 提交于 2019-12-11 19:02:08
问题 I'm trying to use a DropDownButton from the Fluent ribbon control in a WPF application using Caliburn.Micro. So far, everything is good. I see a list of my Unicorns as GalleryItems in the DropDownButton. The only problem is that I could not get the "ShowUnicorn()" working. When I click on an item from the DropDownButton's list it does nothing. Am I doing something wrong? This is the code that I use: <Fluent:DropDownButton Header="Farm" LargeIcon="..\..\Resources\unicorn48.png"> <Fluent

MVVM, use new Windows or Views?

别等时光非礼了梦想. 提交于 2019-12-11 18:36:43
问题 After finishing some by-hand projects, my recent project implements the MVVM pattern using Caliburn.Micro - but I still struggle with some architectural problems. Mainly: My ViewModel contains a BindableCollection ProfilesCollection of Profiles . My view has a button to add new profiles. But since the profiles are complex I want the button click to open a new window where I can fill in the details, and then return back to the main window. In my previous by hand approach I made the

How to Bind ComboBox Inside ItemsControl with Caliburn.Micro?

 ̄綄美尐妖づ 提交于 2019-12-11 16:47:45
问题 This is my project using WPF with Caliburn.Micro. In my view I have an ItemsControl that bound to a BindableCollection, in the coresponding ViewModel, of a record class (MemberVotes). The class just has two fields: MemberName and Vote. The ViewModel also has a second BindableCollection of type string (VoteOptions). The Handle method in the ViewModel loads the data into both BindableCollections. The MemberVotes is loaded from the database and the VoteOptions is loaded by adding a new string

Caliburn.Micro IChild.Parent is null unless activated by conductor

妖精的绣舞 提交于 2019-12-11 16:15:13
问题 I have a Parent and Child viewmodel: public class ParentViewModel : Screen { public ChildViewModel Child { get; set; } } public class ChildViewModel : PropertyChangedBase, IChild { } When the Parent VM is displayed using Conductor.ActivateItem() , Caliburn.Micro does the usual labours of searching through the view model object graph and looking for views to display etc. After all this is completed, I find that while ParentViewModel.Parent is a reference to the Conductor, ChildViewModel.Parent

Drag and Drop Files into WPF with Caliburn Micro Framework

做~自己de王妃 提交于 2019-12-11 13:53:43
问题 I have a WPF app written using the Caliburn Micro framework for MVVM stuff. I have found examples of accepting a dragged file into the wpf app from the codebehind file of the usercontrol. I have not been able to find an example of how to proper do this using a MVVM approach ? Any hints on how to do this? 回答1: I haxed something together that solved my needs here and now. Could be more general. <i:Interaction.Triggers> <Trigger:RoutedEventTrigger EventName="DragQuery"> <cal:ActionMessage

Caliburn.Micro Drag & Drop of a File in a WPF

耗尽温柔 提交于 2019-12-11 13:40:27
问题 I Have create and desktop application with Caliburn.Micro (2.0.1) and now I need to add a drag&drop behavior, the user will drag a file from the Windows Explorer and I need to get the path of it, however I´m searching for 2 days now and I don´t found any example or explanation of how to add a Drag&Drop behavior for the Caliburn.Micro. I found a question about it (Drag and Drop Files into WPF with Caliburn Micro Framework) but that don´t workout. I have tried a lot of different maners but now

What is best technique for switching Xaml views?

落花浮王杯 提交于 2019-12-11 12:53:44
问题 I have "alternative" xaml views for a viewmodel and I am currently using a technique where I set the style property on the view (containing a control template) and would like to know what is the best/preferred Caliburn technique to re-invoke conventions, bindings, etc., that are setup initially by Caliburn when showing the viewmodel. I am using a View-Model-First approach, so possibly I am using the wrong technique and should be looking at a way (e.g. View contexts) to have the Viewmodel

How to leverage designer when using a ViewModel first approach and composition

痞子三分冷 提交于 2019-12-11 09:39:50
问题 I have some xaml like: <ContentControl x:Name="MyContent" /> and then on my ViewModel there is, of course, a MyContent property which references a ViewModel. Then Caliburn does its compositional magic. This is great, but in design time I can't see the composition. I see 'most' people raving about the view model first approach, but I'm a little baffled as to whether there's a way to leverage the designer when doing this that I haven't yet realized or do all the vm first people just live with