Namek Dev
a developer's log
NamekDev

WPF/Silverlight Design Data without XAML

February 19, 2014

Here’s a class for our sample data. That’s where the data should go into.

public class MainViewModelDesignData : MainViewModel {
    public MainViewModelDesignData() {
        // TODO: instantiate your sample data
    }
}

In App.xml define your namespace:

xmlns:models="clr-namespace:YourApp.ViewModels"

and then:

<Application.Resources>
    <models:MainViewModel x:Key="DesignDataContext" />
</Application.Resources>

The last step - instantiate sample data as DesignContext. You can do it in your Window, Page or whatever. I did it in MainPage.xaml in my Windows Phone 7 application:

→ Continue reading Visual Studio, WPF/Silverlight, csharp

Interface with basic implementation in C#

February 2, 2013

Today we have simple question:

How to avoid abstract classes by giving base implementation?

The story

Once in a time I was building animation system which was planned to be used in IGWOCTISI project. It happened that I wanted to created some predefined tweens (animated translations) like ScaleTo, MoveTo, RotateBy and so on.

In the horizon appeared a requirement which was pretty straightforward:

public class MoveTo<T> : Animation<T>
        where T : ITransformable

The fact was that my type T not always was able to be some Transformable object.

→ Continue reading csharp, gamedev, languages, Visual Studio

Visual Studio 2010 also may be messy

November 9, 2011

My C: partition on Windows is too small so sometimes I have problems with space. I have made a recent discovery that not only Windows itself but also Visual Studio 2010 is an out-of-space-situation helper.

C:\ProgramData\Microsoft Visual Studio\10.0\TraceDebugging

This is where you may find lots of files which will not be probably needed anymore. I’ve just deleted 2.5GB from there. I was shocked it was that much.

I recommend WinDirStat. It’s a cool and simple application that helped me to find the path given above.

→ Continue reading IDEs, Visual Studio