Tag: silverlight

Microsoft LightSwitch

Microsoft Visual Studio LightSwitch gives you a simpler and faster way to create professional-quality Silverlight business applications for the desktop, the Web, and the cloud.

It offers little customization, but has a good template to create and modify SQL data.


Silverlight Tab control with Tab Items on left

<UserControl xmlns:controls=”clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls”
    x:Class=”SilverlightApplication18.MainPage”
    xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation
    xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml
    xmlns:toolkit=”clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit”           
    Width=”400″ Height=”300″>
    <Grid x:Name=”LayoutRoot” Background=”White”>
        <controls:TabControl Margin=”10″ TabStripPlacement=”Left”>
            <controls:TabItem  >
                <controls:TabItem.Header>
                    <toolkit:LayoutTransformer >
                        <TextBlock Text=”Tab1″/>
                        <toolkit:LayoutTransformer.LayoutTransform>
                            <RotateTransform Angle=”-90″></RotateTransform>
                        </toolkit:LayoutTransformer.LayoutTransform>
                    </toolkit:LayoutTransformer>
                </controls:TabItem.Header>
                <TextBlock  Margin=”10″ Text=”some content in Tab1″/>              
            </controls:TabItem>
            <controls:TabItem   >
                <controls:TabItem.Header>
                    <toolkit:LayoutTransformer >
                        <TextBlock Text=”Tab2″/>
                        <toolkit:LayoutTransformer.LayoutTransform>
                            <RotateTransform Angle=”-90″></RotateTransform>
                        </toolkit:LayoutTransformer.LayoutTransform>
                    </toolkit:LayoutTransformer>
                </controls:TabItem.Header>
                <TextBlock Margin=”10″ Text=”some content in Tab2″/>              
            </controls:TabItem>
        </controls:TabControl>
    </Grid>
</UserControl>


Silverlight Text Animations

This is a super cool addon for silverlight that does a lot of cool animations.

Link to Page


Silverlight Combobox with Selected Item, Selected Value

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;

namespace Ravi.UI.Silverlight
{
///


/// Custom combobox because databinding doesn’t work correctly
///

public class ComboBox : System.Windows.Controls.ComboBox
{
#region Constructor

///


/// Constructor
///

public ComboBox()
{
this.Loaded += new RoutedEventHandler(ComboBox_Loaded);
this.SelectionChanged += new SelectionChangedEventHandler(ComboBox_SelectionChanged);
}

#endregion

#region Events

///


/// Loaded Event
///

/// /// void ComboBox_Loaded(object sender, RoutedEventArgs e)
{
SetSelectionFromValue();
}

private object _selection;

void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.AddedItems.Count > 0)
{
_selection = e.AddedItems[0];
SelectedValue = GetMemberValue(_selection);
}
else
{
_selection = null;
SelectedValue = null;
}
}


Silverlight DatePicker with Date Only

using System.Windows.Controls;
using System.Windows.Controls.Primitives;

namespace Ravi.UI.Silverlight
{
///


/// Custom date picker control to override standard
/// date picker behavior
///

public class DatePicker : System.Windows.Controls.DatePicker
{
///
/// set the text to null if it is invalid
///

/// protected override void OnDateValidationError(DatePickerDateValidationErrorEventArgs e)
{
this.Text = this.SelectedDate == null ? null : this.SelectedDate.ToString();
base.OnDateValidationError(e);
}

///


/// Setting the DataPicker TextBox to 10 Characters only.
///

public override void OnApplyTemplate()
{
base.OnApplyTemplate();
DatePickerTextBox datePickerTextBox = base.GetTemplateChild(“TextBox”) as DatePickerTextBox;
if (datePickerTextBox != null)
datePickerTextBox.MaxLength = 10;

}
}
}


  • Cloud World

  • Custom Search



  • Cyberbrutus
    iDream theme by Templates Next | Powered by WordPress

    Switch to our mobile site