I do it in SmartAssembly itself, under the Obfuscation section. Click on the Exclusions option next to the assembly that contains the View and ViewModel namespaces. You want to exclude all of the .ViewModels and .Views namespaces.
↧
New Post: Caliburn Obfuscation
↧
New Post: RadContextMenu with caliburn.micro
name the longlistselector and use that as the ElementName for the menu. Don't name it "Collections" though.
it has to do with the visual tree and being seen
it has to do with the visual tree and being seen
↧
↧
Commented Issue: WinRT: Specifying RequestedTheme in XAML crashes unit test runner [276]
If the RequestedTheme is specified inside markup of App.xaml, then MSTest test projects fail to run with the following errors:
Unhandled exception at 0x0FF66C57 (Windows.UI.Xaml.dll) in vstest.executionengine.appcontainer.x86.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x058ADAF8, 0x00000001).
*Output window:*
Exception has been thrown by the target of an invocation.
*Windows event viewer:*
Activation of the app a1864528-865b-4c7b-bf66-b13cba69fbe6_xczrxaf31gmnm!vstest.executionengine.x86.App for the Windows.Launch contract failed with error: The remote procedure call failed..
*Stack trace:*
> combase.dll!RoFailFastWithErrorContextInternal(HRESULT hrError=0x8000ffff, unsigned long cStowedExceptions=1, _STOWED_EXCEPTION_INFORMATION_V1 * * aStowedExceptionPointers=0x058adaf8) Line 853 C++
Windows.UI.Xaml.dll!DirectUI::ErrorHelper::ProcessUnhandledErrorForUserCode(long) Unknown
Windows.UI.Xaml.dll!DirectUI::DXamlCore::EnsureCoreApplicationInitialized(void) Unknown
Windows.UI.Xaml.dll!DirectUI::FrameworkView::Initialize(struct Windows::ApplicationModel::Core::ICoreApplicationView *) Unknown
twinapi.dll!5d8cb64f() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for twinapi.dll]
twinapi.dll!5d8cbb23() Unknown
twinapi.dll!5d8cb88e() Unknown
SHCore.dll!748a59e1() Unknown
kernel32.dll!76b08543() Unknown
ntdll.dll!7743ac69() Unknown
ntdll.dll!7743ac3c() Unknown
This occurs using both Visual Studio 2012 test runner and Resharper.
This does not happen if:
- The application is declared as an <Application> (rather than CaliburnApplication)
- The RequestedTheme is set inside the code-behind constructor
Replicated in NuGet package version 1.4 and latest source from 14 Jan 2013 (ad5acda9d1c3).
Repro attached
Comments: Actually, a similar error DEP0700 - The remote procedure call failed - happens without `RequestedTheme`, but with `CaliburnApplication`. It seems the use of some custom types, e.g., `CaliburnApplication`, in Xaml is incompatible with the WinRT unit test runner, because they don’t provide proper `IXamlType interface implementations`. See [https://connect.microsoft.com/VisualStudio/feedback/details/790477/winrt-mstest-runner-fails-when-using-ilist-t-properties-of-custom-types-from-xaml](https://connect.microsoft.com/VisualStudio/feedback/details/790477/winrt-mstest-runner-fails-when-using-ilist-t-properties-of-custom-types-from-xaml) A workaround is to reference the binary from the file system instead of the app project.
Unhandled exception at 0x0FF66C57 (Windows.UI.Xaml.dll) in vstest.executionengine.appcontainer.x86.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x058ADAF8, 0x00000001).
*Output window:*
Exception has been thrown by the target of an invocation.
*Windows event viewer:*
Activation of the app a1864528-865b-4c7b-bf66-b13cba69fbe6_xczrxaf31gmnm!vstest.executionengine.x86.App for the Windows.Launch contract failed with error: The remote procedure call failed..
*Stack trace:*
> combase.dll!RoFailFastWithErrorContextInternal(HRESULT hrError=0x8000ffff, unsigned long cStowedExceptions=1, _STOWED_EXCEPTION_INFORMATION_V1 * * aStowedExceptionPointers=0x058adaf8) Line 853 C++
Windows.UI.Xaml.dll!DirectUI::ErrorHelper::ProcessUnhandledErrorForUserCode(long) Unknown
Windows.UI.Xaml.dll!DirectUI::DXamlCore::EnsureCoreApplicationInitialized(void) Unknown
Windows.UI.Xaml.dll!DirectUI::FrameworkView::Initialize(struct Windows::ApplicationModel::Core::ICoreApplicationView *) Unknown
twinapi.dll!5d8cb64f() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for twinapi.dll]
twinapi.dll!5d8cbb23() Unknown
twinapi.dll!5d8cb88e() Unknown
SHCore.dll!748a59e1() Unknown
kernel32.dll!76b08543() Unknown
ntdll.dll!7743ac69() Unknown
ntdll.dll!7743ac3c() Unknown
This occurs using both Visual Studio 2012 test runner and Resharper.
This does not happen if:
- The application is declared as an <Application> (rather than CaliburnApplication)
- The RequestedTheme is set inside the code-behind constructor
Replicated in NuGet package version 1.4 and latest source from 14 Jan 2013 (ad5acda9d1c3).
Repro attached
Comments: Actually, a similar error DEP0700 - The remote procedure call failed - happens without `RequestedTheme`, but with `CaliburnApplication`. It seems the use of some custom types, e.g., `CaliburnApplication`, in Xaml is incompatible with the WinRT unit test runner, because they don’t provide proper `IXamlType interface implementations`. See [https://connect.microsoft.com/VisualStudio/feedback/details/790477/winrt-mstest-runner-fails-when-using-ilist-t-properties-of-custom-types-from-xaml](https://connect.microsoft.com/VisualStudio/feedback/details/790477/winrt-mstest-runner-fails-when-using-ilist-t-properties-of-custom-types-from-xaml) A workaround is to reference the binary from the file system instead of the app project.
↧
New Post: Caliburn Obfuscation
SmartAssembly doesn't try to include reference starting with System. If you turn on self-diagnostic mode (remember to turn it off later), you will most likely find out that you need to copy System.Windows.Interactivity.dll to your target folder.
↧
New Post: PhoneBaseBootstrapper Start missing
Hello!
I installed Caliburn.Micro.Start via nuget for WP8. But when I want run the project I have next error:
The name 'Start' does not exist in the current context.
Any ideas?
Thank you
I installed Caliburn.Micro.Start via nuget for WP8. But when I want run the project I have next error:
The name 'Start' does not exist in the current context.
Any ideas?
Thank you
↧
↧
New Post: CaliburnBindableAppBar WP8
I installed CM 2.0.0.0 and BindableAppBar 1.0.5.0, but I can't add BindableAppBarButton to my page, I have next error: Could not load file or assembly 'Caliburn.Micro, Version=1.5.2.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
↧
New Post: PhoneBaseBootstrapper Start missing
SOLVED: You should use Initialize method. Please correct the documentation.
↧
Created Unassigned: Caliburn.Micro.Start Bootstrapper has call to nonexistant method "Start()" [363]
In the startup code generated by installing the Caliburn.Micro.Start package, the constructor in AppBootsrtapper.cs contains a call to a Start() method, which is not defined.
As a result, the project cannot compile.
Users can fix this by removing the call to Start() and replacing it with Initialize() (see below), but first-time users are not likely to know that this is what needs to happen.
```
public AppBootstrapper() {
//Start(); <- this doesn't work.
Initialize(); //this works
}
```
As a result, the project cannot compile.
Users can fix this by removing the call to Start() and replacing it with Initialize() (see below), but first-time users are not likely to know that this is what needs to happen.
```
public AppBootstrapper() {
//Start(); <- this doesn't work.
Initialize(); //this works
}
```
↧
New Post: Handling Focus?
hi
Sorry to bump this old post, but I found this answer which solved my problem... but I don't understand one thing :
IsFocused="{Binding UserNameIsFocused, Mode=TwoWay}"
???
I've tried the following, which is a little more understandable and still work :
IsFocused="{Binding UserName.IsFocused, Mode=TwoWay}"
But the following throw an exception, telling me that IsFocused is a ReadOnly property :
IsFocused="{Binding IsFocused, ElementName=UserName, Mode=TwoWay}"
Thanks to the one who can explain this :)
Sorry to bump this old post, but I found this answer which solved my problem... but I don't understand one thing :
<TextBox x:Name="UserName" Style="{StaticResource LoginTextBox}">
<i:Interaction.Behaviors>
<localBehaviors:FocusBehavior HasInitialFocus="True" IsFocused="{Binding UserNameIsFocused, Mode=TwoWay}"/>
</i:Interaction.Behaviors>
</TextBox>
Why the following syntax is working :IsFocused="{Binding UserNameIsFocused, Mode=TwoWay}"
???
I've tried the following, which is a little more understandable and still work :
IsFocused="{Binding UserName.IsFocused, Mode=TwoWay}"
But the following throw an exception, telling me that IsFocused is a ReadOnly property :
IsFocused="{Binding IsFocused, ElementName=UserName, Mode=TwoWay}"
Thanks to the one who can explain this :)
↧
↧
New Post: Login view - Login button is not disabled initially based on CanLogin value, untill we click it for the first time.
Hi people,
I just started looking into Caliburn Micro and I started up with a simple login page implementation.
My page xaml looks like this
But until I click the login for the first time, the login button is always enabled.
Please help me fix this.
I just started looking into Caliburn Micro and I started up with a simple login page implementation.
My page xaml looks like this
<StackPanel Grid.Column="1" Grid.Row="1">
<StackPanel Orientation="Horizontal"
Margin="2">
<TextBlock Text="Login name"
Width="100"/>
<TextBox x:Name="LoginName"
Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal"
Margin="2">
<TextBlock Text="Password"
Width="100"/>
<TextBox x:Name="Password"
Width="200" />
</StackPanel>
<Button x:Name="Login"
Content="Submit"
Width="100"
Margin="2"/>
</StackPanel>
And my view model class looks like thispublic class LoginViewModel : PropertyChangedBase
{
private string loginName;
public string LoginName
{
get
{
return loginName;
}
set
{
loginName = value;
NotifyOfPropertyChange(() => LoginName);
NotifyOfPropertyChange(() => CanLogin);
}
}
private string password;
public string Password
{
get { return password; }
set
{
password = value;
NotifyOfPropertyChange(() => Password);
NotifyOfPropertyChange(() => CanLogin);
}
}
public bool CanLogin
{
get
{
return !string.IsNullOrWhiteSpace(LoginName) && !string.IsNullOrWhiteSpace(Password);
}
}
public void Login()
{
}
}
I am not sure if there are any mistakes in this.But until I click the login for the first time, the login button is always enabled.
Please help me fix this.
↧
Commented Issue: Problem with convention binding to decimal property [90]
When a Silverlight textbox is bound to a decimal property using conventions, it is not possible to type a number followed by a decimal point. As soon as the decimal point is entered it disappears and the cursor moves back to the beginning of the textbox.
ViewModel:
public class TestViewModel : Screen
{
private decimal anyNumber;
public decimal AnyNumber
{
get { return anyNumber; }
set
{
anyNumber = value;
NotifyOfPropertyChange(() => AnyNumber);
}
}
}
View:
<UserControl x:Class="SilverlightApplication1.TestView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel>
<TextBox x:Name="AnyNumber" Width="200" />
</StackPanel>
</UserControl>
Comments: I have the same issue too with British CultureInfo (en-GB). Textbox bound to a double VS 2013 - CM 1.5.2 - WPF Client (NET 4.5). When trying to enter 2.3 I can type the 2 but pressing the '.' doesn't append the decimal place then the 3 is added to give 23. At this point I can click the mouse and add the '.' in the middle.
ViewModel:
public class TestViewModel : Screen
{
private decimal anyNumber;
public decimal AnyNumber
{
get { return anyNumber; }
set
{
anyNumber = value;
NotifyOfPropertyChange(() => AnyNumber);
}
}
}
View:
<UserControl x:Class="SilverlightApplication1.TestView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel>
<TextBox x:Name="AnyNumber" Width="200" />
</StackPanel>
</UserControl>
Comments: I have the same issue too with British CultureInfo (en-GB). Textbox bound to a double VS 2013 - CM 1.5.2 - WPF Client (NET 4.5). When trying to enter 2.3 I can type the 2 but pressing the '.' doesn't append the decimal place then the 3 is added to give 23. At this point I can click the mouse and add the '.' in the middle.
↧
New Post: Screen View Caching Bug?
Hi There,
I am new to Caliburn.Micro, so I may just be missing something obvous...
I have a ShellView that has a ListBox bound to a list of 3 ViewModels (@ : Screen), and it's SelectedItem bound to the ActiveItem; and there is a ContentControl bound to the ActiveItem as well. The ShellViewModel : Conductor<IScreen>.Collection.OneActive. When an item is selected in the ListBox, the correct view is rendered in the ContentControl, and this works correctly for all 3 of the items, the first time their views are rendered.
However, there appears to be a bug in the view caching, and here's how it occurs:
Any ideas?
Thanks for your help!
I am new to Caliburn.Micro, so I may just be missing something obvous...
I have a ShellView that has a ListBox bound to a list of 3 ViewModels (@ : Screen), and it's SelectedItem bound to the ActiveItem; and there is a ContentControl bound to the ActiveItem as well. The ShellViewModel : Conductor<IScreen>.Collection.OneActive. When an item is selected in the ListBox, the correct view is rendered in the ContentControl, and this works correctly for all 3 of the items, the first time their views are rendered.
However, there appears to be a bug in the view caching, and here's how it occurs:
- Clicking the 1st item creates and renders a new 1st view
- Clicking the 2nd item creates and renders a new 2nd view
- Clicking the 3rd item creates and renders a new 3rd view
- Clicking the 1st item creates and renders a new 1st view
- Clicking the 2nd item renders the existing 2nd view
- Clicking the 3rd item renders the existing 3rd view
- Clicking the 1st item renders the existing 1st view
- Clicking the 2nd item renders the existing 2nd view
- Clicking the 3rd item renders the existing 3rd view
-
Etc.
Any ideas?
Thanks for your help!
↧
New Post: Handling Focus with Caliburn.Micro
Thanks @kishorejangid, it works !!! you save my time ... :)
I add few lines to enable/disable a control
public static void Enable(this IViewAware screen, Expression<Func<object>> propertyExpression)
I add few lines to enable/disable a control
public static void Enable(this IViewAware screen, Expression<Func<object>> propertyExpression)
{ Enable(screen, propertyExpression.GetMemberInfo().Name); }
public static void Enable(this IViewAware screen, string property)
{
Contract.Requires(property != null, "Property cannot be null.");
var view = screen.GetView() as UserControl;
if (view == null) return;
var control = FindChild(view, property);
if (control != null) { control.IsEnabled = true; }
}
public static void Disable(this IViewAware screen, Expression<Func<object>> propertyExpression)
{ Disable(screen, propertyExpression.GetMemberInfo().Name); }
public static void Disable(this IViewAware screen, string property)
{
Contract.Requires(property != null, "Property cannot be null.");
var view = screen.GetView() as UserControl;
if (view == null) return;
var control = FindChild(view, property);
if (control != null) { control.IsEnabled = false; }
}
↧
↧
New Post: Screen View Caching Bug?
I see the same thing. I use caliburn 1.5 and 2.0. Please check it.
↧
New Post: CaliburnBindableAppBar WP8
because the BindableAppBar used cm version 1.5, you can get source code of bindableAppBar from GitHub, then rebuild it,
for instance, i upload that code here: https://github.com/george674834080/BindableAppBarWP8
for instance, i upload that code here: https://github.com/george674834080/BindableAppBarWP8
↧
New Post: Detect dormant or Tombstone navigate to view
hello,
i use a caliburn micro. In my app i detect a dormant or Tombstone state in AppBootStrapper.cs
not is possibile use NavigationService in AppBootStrapper?
For example
i use a caliburn micro. In my app i detect a dormant or Tombstone state in AppBootStrapper.cs
protected override void OnActivate(object sender, ActivatedEventArgs e)
{
}
i would "REDIRECT" app on my login page(always)not is possibile use NavigationService in AppBootStrapper?
For example
protected override void OnActivate(object sender, ActivatedEventArgs e)
{
NavigationService.UriFor<LoginViewModel>().Navigate();
}
thanks↧
New Post: CaliburnBindableAppBar WP8
Thank you!
↧
↧
New Post: Changing DataContext, does not change target
Having a view which uses Action.Target and I change the view's DataContext, then the actions target doesn't always change.
Simple Test-Program:
95ee17fe-50e9-4c13-b98d-c27b2dd19d79: New DataContext created
95ee17fe-50e9-4c13-b98d-c27b2dd19d79
95ee17fe-50e9-4c13-b98d-c27b2dd19d79: Doing something...
Assigning new datacontext
dad65fc8-b3c1-4742-ae64-2ae3a09689fa: New DataContext created
dad65fc8-b3c1-4742-ae64-2ae3a09689fa
95ee17fe-50e9-4c13-b98d-c27b2dd19d79: Doing something...
My DataContext changed from 95ee17fe-50e9-4c13-b98d-c27b2dd19d79 to dad65fc8-b3c1-4742-ae64-2ae3a09689fa but DoSomething() is still called on the old DataContext.
But if you try often enough, it will sometimes suddenly work:
6128332a-83ad-47d2-84e3-fec60fdcf957: New DataContext created
6128332a-83ad-47d2-84e3-fec60fdcf957
27eb6a9f-c2e4-4a40-8a5c-45d8fd1d0e4f: Doing something...
Assigning new datacontext
8f5ee04a-ffa8-4705-ae0c-94a01116d5a3: New DataContext created
8f5ee04a-ffa8-4705-ae0c-94a01116d5a3
8f5ee04a-ffa8-4705-ae0c-94a01116d5a3: Doing something...
Any idea what's going wrong here? I've tested this with various versions from 1.0.0 up to 2.0.0 and it behaves exactly the same.
Simple Test-Program:
<Window x:Class="CaliburnMicroTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cal="http://www.caliburnproject.org"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
Title="MainWindow"
Width="525"
Height="350"
x:Name="_this">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewKeyDown">
<cal:ActionMessage MethodName="KeyPressed">
<cal:Parameter Value="$eventArgs" />
</cal:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
<StackPanel VerticalAlignment="Center">
<Button cal:Action.Target="{Binding ElementName=_this}" cal:Message.Attach="NewDataContext">Change DataContext</Button>
<Button cal:Action.Target="{Binding ElementName=_this}" cal:Message.Attach="CheckCurrentDataContext">Check DataContext</Button>
<Button cal:Message.Attach="DoSomething">Do something with current DataContext</Button>
</StackPanel>
</Window>
using System;
using System.Windows;
using System.Windows.Input;
namespace CaliburnMicroTest
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
DataContext = new DataContext();
}
public void NewDataContext()
{
Console.WriteLine("Assigning new datacontext");
DataContext = new DataContext();
}
public void CheckCurrentDataContext()
{
((DataContext) DataContext).PrintId();
}
}
public class DataContext
{
private Guid _id;
public DataContext()
{
_id = Guid.NewGuid();
Console.WriteLine(_id + ": New DataContext created");
}
public void DoSomething()
{
Console.WriteLine(_id + ": Doing something...");
}
public void KeyPressed(KeyEventArgs args)
{
Console.WriteLine(_id + ": key pressed");
}
public void PrintId()
{
Console.WriteLine(_id );
}
}
}
What happens is then e.g.:95ee17fe-50e9-4c13-b98d-c27b2dd19d79: New DataContext created
95ee17fe-50e9-4c13-b98d-c27b2dd19d79
95ee17fe-50e9-4c13-b98d-c27b2dd19d79: Doing something...
Assigning new datacontext
dad65fc8-b3c1-4742-ae64-2ae3a09689fa: New DataContext created
dad65fc8-b3c1-4742-ae64-2ae3a09689fa
95ee17fe-50e9-4c13-b98d-c27b2dd19d79: Doing something...
My DataContext changed from 95ee17fe-50e9-4c13-b98d-c27b2dd19d79 to dad65fc8-b3c1-4742-ae64-2ae3a09689fa but DoSomething() is still called on the old DataContext.
But if you try often enough, it will sometimes suddenly work:
6128332a-83ad-47d2-84e3-fec60fdcf957: New DataContext created
6128332a-83ad-47d2-84e3-fec60fdcf957
27eb6a9f-c2e4-4a40-8a5c-45d8fd1d0e4f: Doing something...
Assigning new datacontext
8f5ee04a-ffa8-4705-ae0c-94a01116d5a3: New DataContext created
8f5ee04a-ffa8-4705-ae0c-94a01116d5a3
8f5ee04a-ffa8-4705-ae0c-94a01116d5a3: Doing something...
Any idea what's going wrong here? I've tested this with various versions from 1.0.0 up to 2.0.0 and it behaves exactly the same.
↧
New Post: Changing DataContext, does not change target
This is really driving me nuts. I ran into the same issue now with a menu item.
Any ideas?
<MenuItem
Header="{Binding Id}"
ca:Action.Target="{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.DataContext.KeyboardLayouts.SelectedKeyboardLayout}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<ca:ActionMessage MethodName="Paste">
This works until the SelectedKeyboardLayout property changes. The Id-Binding of the MenuItem's Header property correctly changes, but the Action target still points to the previous SelectedKeyboardLayout property value.Any ideas?
↧
New Post: Changing DataContext, does not change target
Here's another example:
Caliburn does not care for the changed target (DataContext.Something). ActionMessage.UpdateContext() does not get called when DataContext.Something changes, so it will always use the old target "cached" in the ActionExecutionContext.
Caliburn does not care for the changed target (DataContext.Something). ActionMessage.UpdateContext() does not get called when DataContext.Something changes, so it will always use the old target "cached" in the ActionExecutionContext.
<Window x:Class="CaliburnTestBed.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cal="http://www.caliburnproject.org"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
Title="MainWindow"
Width="525"
Height="350">
<StackPanel>
<Button cal:Message.Attach="ChangeSomething">Change Something</Button>
<Button Content="{Binding Something.Id, FallbackValue=Foo}">
<Button.ContextMenu>
<ContextMenu IsEnabled="True">
<MenuItem Header="{Binding Id}" cal:Action.Target="{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.DataContext.Something}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<cal:ActionMessage MethodName="DoSomething">
<cal:Parameter Value="{Binding Id}"></cal:Parameter>
</cal:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</MenuItem>
</ContextMenu>
</Button.ContextMenu>
</Button>
</StackPanel>
</Window>
using System;
using System.ComponentModel;
using Caliburn.Micro;
namespace CaliburnTestBed
{
/// <summary>
/// Interaktionslogik für MainWindow.xaml
/// </summary>
public partial class MainWindow : INotifyPropertyChanged {
private Something something;
public MainWindow() {
LogManager.GetLog = t => new DebugLog(t);
InitializeComponent();
DataContext = this;
//Something = new Something();
}
public Something Something {
get { return something; }
set {
something = value;
if (PropertyChanged != null) {
PropertyChanged(this, new PropertyChangedEventArgs("Something"));
}
}
}
public void ChangeSomething() {
Something = new Something();
}
public event PropertyChangedEventHandler PropertyChanged;
}
public class Something {
public Something() {
Id = Guid.NewGuid();
}
public Guid Id { get; set; }
public void DoSomething(Guid id) {
if (Id != id) {
Console.WriteLine("DoSomething({0}) was called on Something with Id {1} - this shouldn't happen!!!", id, Id);
}
}
public override string ToString() {
return "Something:" + Id;
}
}
}
↧