Welcome Guest, you are in: Login

FDOT Wiki

RSS RSS

GisFramework



Search the wiki
»
The GIS Framework provides attributes for basic rendering of common UI elements. These can be used in the viewmodel as an alternative to constructing a dialog's layout in XAML. This can be especially useful to speed up Developing New Components. The following attributes are currently supported:

General Attributes

NameDescriptionNamed Parameters
DisplayNameAttributeDefines the text on the field labelName (string)
ToolTipTextAttributeDefines the tooltip text for the fieldText (string)
ResizableAttributeAllows the window to be resized by the user
HiddenAttributePrevents the field from being displayed
AutoResizeAttributeAllows the generated field to resize vertically and fill available space when the user resizes the host dialog

Field-based Attributes

NameDescriptionNamed Parameters
TextAttributeRender field as TextBox or PasswordBox (Secret=true)Secret (bool)
DropdownAttributeRender field as ComboBoxoptionSource (string=Field|Property|Method|Enumeration|None)
CheckAttributeRender field as checkbox
SwitchButtonAttributeRender field as SwitchButton (iPhone-style on/off switch)
DateAttributeRender field as DatePicker
NumericUpDownAttributeRender field as NumericUpDownMinimum (int default=0), Maximum (int default=100), DecimalPlaces (int default=0), Increment (int default=1)
LabelAttributeRender field as read-only TextBlock
ProgressAttributeRender field as ProgressBarMinimum (int default=0), Maximum (int default=100)
SliderAttributeRender field as SliderMinimum (int default=0), Maximum (int default=100)
ListAttributeRender field as ListBoxdisplayMemberPath (string)
TableAttributeRender field as DataGrid
ChartAttributeRender field as ChartChartType (ChartTypeEnum=Line|Column|Bar|Pie), IndependentAxisName (string), DependentAxisName (string)

Action-based Attributes

NameDescriptionNamed Parameters
ActionAttributeRender method as Button

Example


[DisplayName("Dialog Created From Attributes Example")]
public class MyComponentSettingsViewModel : SettingsViewModel
{
    private static MyComponentSettingsViewModel _viewModel = new MyComponentSettingsViewModel();

    private MyComponentSettingsViewModel()
    {
        DialogServiceArgs.Id = "mycomponentsettingsviewmodel";
        DialogServiceArgs.Title = "My Component Settings";
    }

    [Hidden]
    public static MyComponentSettingsViewModel Instance
    {
        get { return _viewModel; }
    }


    [Label]
    [DisplayName("")]
    public string TextMessage
    {
        get
        {
            return "This example uses the LayoutManager to build a view based on\n" +
                    "a viewmodel with custom attributes that describe how the\n" +
                    "viewmodel should be rendered.  Actions can also be used via\n" +
                    "the ActionAttribute applied to a method.";
        }
    }


    [SwitchButton]
    [DisplayName("Switch Button")]
    [ToolTipText("Sets a boolean property and persists it to Silverlight Isolated Storage")]
    public bool MyBoolProperty
    {
        get { return StateManager.GetProperty<bool>("MyBoolProperty"); }
        set
        {
            StateManager.SetProperty("MyBoolProperty", value);
            NotifyOfPropertyChange(() => MyBoolProperty);
        }
    }


    [ActionAttribute]
    [DisplayName("Do Something Now")]
    public void DoSomething()
    {
        MessageBox.Show("Can invoke an action here.");
    }
}

See Also

Any Questions or Comments? Email
Some of the icons created by FamFamFam.