Created
April 28, 2015 16:23
-
-
Save dbuksbaum/a4d5e9d5db251191df63 to your computer and use it in GitHub Desktop.
Caliburn.Micro – Hello World
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Application x:Class="HelloWorld.App" | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| xmlns:local="clr-namespace:HelloWorld"> | |
| <Application.Resources> | |
| <ResourceDictionary> | |
| <ResourceDictionary.MergedDictionaries> | |
| <ResourceDictionary> | |
| <local:HelloWorldBootStrapper x:Key="bootstrapper" /> | |
| </ResourceDictionary> | |
| </ResourceDictionary.MergedDictionaries> | |
| </ResourceDictionary> | |
| </Application.Resources> | |
| </Application> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using Caliburn.Micro; | |
| using HelloWorld.ViewModels; | |
| namespace HelloWorld | |
| { | |
| public class HelloWorldBootStrapper : Bootstrapper<MainViewModel> | |
| { | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <UserControl x:Class="HelloWorld.Views.MainView" | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
| mc:Ignorable="d" | |
| d:DesignHeight="300" d:DesignWidth="500"> | |
| <StackPanel> | |
| <StackPanel Orientation="Horizontal"> | |
| <TextBlock Text="Name: " /> | |
| <TextBox x:Name="Name" /> | |
| </StackPanel> | |
| <TextBlock x:Name="HelloString"/> | |
| <Button x:Name="SayHello" Content="Click Me"/> | |
| </StackPanel> | |
| </UserControl> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using Caliburn.Micro; | |
| namespace HelloWorld.ViewModels | |
| { | |
| public class MainViewModel : PropertyChangedBase | |
| { | |
| private string _name; | |
| private string _helloString; | |
| public string Name | |
| { | |
| get { return _name; } | |
| set | |
| { | |
| _name = value; | |
| NotifyOfPropertyChange(() => Name); | |
| NotifyOfPropertyChange(() => CanSayHello); | |
| } | |
| } | |
| public string HelloString | |
| { | |
| get { return _helloString; } | |
| private set | |
| { | |
| _helloString = value; | |
| NotifyOfPropertyChange(() => HelloString); | |
| } | |
| } | |
| public bool CanSayHello | |
| { | |
| get { return !string.IsNullOrWhiteSpace(Name); } | |
| } | |
| public void SayHello(string name) | |
| { | |
| HelloString = string.Format("Hello {0}.", Name); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you application does not works
Severity Code Description Project File Line Suppression State
Error The name "HelloWorldBootStrapper" does not exist in the namespace "clr-namespace:HelloWorld".