Using MEF in a Windows Store App: Listing 3

MainPage.xaml with Grid.

<Page
    x:Class="VSMMefDemo.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:VSMMefDemo"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
    <StackPanel HorizontalAlignment="Center" Margin="0,20,0,20">
            <TextBlock>Input</TextBlock>
            <TextBox Name="Input" MinWidth="300"></TextBox>
            <TextBlock>Select a Validation Type</TextBlock>
            <ComboBox Name="ValidationTypes" ItemsSource="{Binding}" DisplayMemberPath="Metadata"
                      SelectedValuePath="Value" 
                      SelectionChanged="ValidationTypes_SelectionChanged"></ComboBox>
            <Button Name="Validate" Click="Validate_Click">Valiate</Button>
            <TextBlock>Result</TextBlock>
            <TextBlock Name="Result"></TextBlock>
    </StackPanel>
    </Grid>
</Page>

About the Author

Eric Vogel is a Senior Software Developer for Red Cedar Solutions Group in Okemos, Michigan. He is the president of the Greater Lansing User Group for .NET. Eric enjoys learning about software architecture and craftsmanship, and is always looking for ways to create more robust and testable applications. Contact him at [email protected].

comments powered by Disqus

Featured

  • Clustering Non-Numeric Data Using C#

    Clustering non-numeric -- or categorial -- data is surprisingly difficult, but it's explained here by resident data scientist Dr. James McCaffrey of Microsoft Research, who provides all the code you need for a complete system using an algorithm based on a metric called category utility (CU), a measure how much information you gain by clustering.

  • So What's Up with Microsoft's (and Everyone Else's) Love of Rust?

    Microsoft already stewards several popular programming languages -- C#, TypeScript, F# -- so what's up with its love of Rust, along with the rest of the world?

  • C# Steps Up Programming Language Popularity Ladder

    Microsoft's C# programming language climbed a year-over-year notch on the TIOBE Index, which measures popularity among developers.

  • VS Code Java Tool Updates Debugging, Refactoring

    The monthly update to the tooling that boosts Java development in the open source, cross-platform Visual Studio Code editor highlights debugging, refactoring and more.

  • Microsoft Plugs Away at Blazor for Mobile in Preview 3

    Microsoft is furthering its work to target mobile app development with Blazor, the ASP.NET Core offering that originally was developed to allow for C#-based web development instead of JavaScript through the use of WebAssembly for the client side.

.NET Insight

Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.

Upcoming Events