caliburn.micro

Caliburn.Micro + Autofac bootstrapping

主宰稳场 提交于 2019-12-09 18:33:39
问题 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 ? 回答1: There

AvalonDock 2 with Caliburn Micro

你。 提交于 2019-12-09 12:41:30
问题 Are there any blogs or articles about using AvalonDock with Caliburn Micro MVVM? Didn't find much when Googling http://avalondock.codeplex.com/ edit: Got an up vote so why not update with a final solution. Full code can be found here https://github.com/AndersMalmgren/FreePIE Most of the avalon related code is found here https://github.com/AndersMalmgren/FreePIE/blob/master/FreePIE.GUI/Shells/MainShellView.xaml Update after Sam's answer Its very, very little that needs to be done to enable

How can I bind source MediaCapture to CaptureElement using Caliburn.Micro?

…衆ロ難τιáo~ 提交于 2019-12-09 06:51:34
问题 On Windows Phone 8.1, I am using the Caliburn.Micro view-model-first approach, but as the view model cannot have any knowledge of the view, I cannot see how I can bind a MediaCapture object to a CaptureElement in the view. 回答1: I had the same problem. I'm using MVVM Light with Windows Phone 8.1 WinRT (Universal Apps). I used ContentControl and binded to CaptureElement: <ContentControl HorizontalAlignment="Left" Width="320" Height="140" Content="{Binding CaptureElement}"/> CaptureElement and

Application MainWindow is null in WPF (using Caliburn Micro)

这一生的挚爱 提交于 2019-12-08 19:10:42
问题 I am developing a WPF application and I need to get a point to the main window of application inside a control. I am using Caliburn Micro. Application.Current.MainWindow is null How can I get a reference to the MainWindow of application in Caliburn Micro? 回答1: That's funny, I've just answered this in another post... Try setting the Application.Current.MainWindow property in the Loaded event in the MainWindow.xaml.cs file: private void MainWindow_Loaded(object sender, RoutedEventArgs e) {

How do you apply a ValueConverter to a convention-based Caliburn.Micro binding?

£可爱£侵袭症+ 提交于 2019-12-08 16:55:05
问题 How do you apply a ValueConverter to a convention-based Caliburn.Micro binding? or do you need to use the {Binding} syntax? I know I could do this <TextBlock Text="{Binding Foo, Converter=fooToBarConverter}" /> but how do I apply that custom converter if I am using Caliburn.Micro's convention over configuration, like <TextBlock x:Name="Foo" /> Thanks, 回答1: You need to replace the ConventionManager.ApplyValueConverter func. By default it only does athe bool => Visibility conversion. Also, you

“Bubbling” events from bound viewmodel goes to parent

旧街凉风 提交于 2019-12-08 12:30:32
问题 First off, I'm still getting used to Caliburn and WPF, so I may be doing this the wrong way. I'd love to know a better way! I have a Conductor shell view model, which has a view with some shared elements, and a content control for the ActiveItem . Now, I want a set of buttons from the ActiveItem view model to be displayed outside the content control, but still have their click events go to the active view model. I've tried adding an ItemsControl like this: <ItemsControl x:Name="ActiveItem

How to add Properties to a ViewModel Class Dynamically in Runtime in C# MVVM

拜拜、爱过 提交于 2019-12-08 12:02:04
问题 In a WPF MVVM(Caliburn Micro) application I have a empty ViewModel and a empty View. (The view model doesn't have any properties, and view doesn't have any fields.) CommonView (CommonView.cs) CommonViewModel (CommonView.xaml - UserControl) There is a need to add properties and fields dynamically to the view and ViewmModel. I have a list of properties in a PropertyInfo object. Based on the PropertyInfo I need to add properties to the ViewModel dynamically during Runtime. Is It Possible? Can

WPF Dynamic Context Menu with Caliburn.Micro

末鹿安然 提交于 2019-12-08 10:24:45
问题 I am trying to create a dynamic context menu in my Caliburn.Micro based application. Can anyone share an example of an effective way to do that? So far, I have a very minimal model for each context menu item: public class ContextMenuUiModel { public string Name { get; set; } } a property in my view model that presents a list of those menu item models: BindableCollection<ContextMenuUiModel> m_ContextMenuItems = new BindableCollection<ContextMenuUiModel> { new ContextMenuUiModel { Name="Item 1"

How to bind caliburn.micro view model to WP8 LongListSelector control?

情到浓时终转凉″ 提交于 2019-12-08 08:36:28
Is there a way to automagically bind a Caliburn.Micro view model to the Windows Phone 8 LongListSelector control and auto-wire the SelectedItem property? If i understand your question correctly, then you want normal Caliburn.Micro conventions to be applied to the LongListSelector control. I don't work with Windows Phone development but i think it can be done by calling the following line of code in the Configure() method of the bootstrapper. ConventionManager.AddElementConvention<LongListSelector>(LongListSelector.ItemsSourceProperty, "SelectedItem", "SelectionChanged"); This code tells

How to bind caliburn.micro view model to WP8 LongListSelector control?

我们两清 提交于 2019-12-08 08:19:48
问题 Is there a way to automagically bind a Caliburn.Micro view model to the Windows Phone 8 LongListSelector control and auto-wire the SelectedItem property? 回答1: If i understand your question correctly, then you want normal Caliburn.Micro conventions to be applied to the LongListSelector control. I don't work with Windows Phone development but i think it can be done by calling the following line of code in the Configure() method of the bootstrapper. ConventionManager.AddElementConvention