Thursday, January 31, 2013

SL with MVVM xaml

<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vm="clr-namespace:MyNamespage.ViewModel"
    xmlns:cod="clr-namespace:MyNamespage.Tools"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    x:Class="MyNamespage.MainPage"
    mc:Ignorable="d" DataContext="{Binding  Main, Source={StaticResource Locator}}"
    d:DesignHeight="600" d:DesignWidth="800">

    <UserControl.Resources>
        <cod:AIImageBuilder x:Name="ImageBuilder"/>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="White">

        <sdk:Label HorizontalAlignment="Left" Height="23" Margin="22,22,0,0" VerticalAlignment="Top" Width="120"/>
        <TextBox Text="{Binding Main.HomeModel.TopTitle, Source={StaticResource Locator}}"
                 HorizontalAlignment="Left" Height="23" Margin="147,22,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="402"/>
        <Image Source="{Binding HomeModel.TopImageUrl, Converter={StaticResource ImageBuilder}}"
               HorizontalAlignment="Left" Height="100" Margin="147,50,0,0" VerticalAlignment="Top" Width="100"/>

    </Grid>
</UserControl>

Tuesday, January 29, 2013

MVC 3 and Silverlight 4 db passing

private void UserControl_Loaded(object sender, RoutedEventArgs e)
    {
      WebClient wc = new WebClient();
      wc.OpenReadCompleted += 
        new OpenReadCompletedEventHandler(wc_OpenReadCompleted);
      wc.OpenReadAsync(new Uri("http://localhost:49520/Products/Index/"));
    }

    void wc_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
    {
      DataContractJsonSerializer json = 
           new DataContractJsonSerializer(typeof(List<Product>));
      IList<Product> result = (List<Product>)(json.ReadObject(e.Result));
      MyGrid.ItemsSource = result;
    }
  }

Saturday, January 12, 2013

How to use Disk Management

How to use Disk Management

To start Disk Management:
  1. Log on as administrator or as a member of the Administrators group.
  2. Click Start, click Run, type compmgmt.msc, and then click OK.
  3. In the console tree, click Disk Management. The Disk Management window appears. Your disks and volumes appear in a graphical view and list view. To customize how you view your disks and volumes in the upper and lower panes of the window, point to Top or Bottom on the View menu, and then click the view that you want to use.