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

  • Visual Studio 2026 Gives Copilot Built-In Skills -- and Makes Them Prove Their Worth

    Microsoft is moving Agent Skills beyond bring-your-own instructions by shipping expert-authored workflows with the IDE, while keeping them off by default until testing shows their benefits justify the additional token use.

  • Copilot AI Billing Shock Met with Meters, Caps and Token-Saving Tools

    GitHub is layering spending limits, expanded credit allowances and increasingly granular usage reporting onto Copilot, while Microsoft is reworking Visual Studio and VS Code to expose -- and reduce -- the cost of agentic development.

  • The AI-Powered Software Development Lifecycle

    René van Osnabrugge makes the case that AI's biggest opportunity in software development is not faster coding -- it's reducing the friction everywhere else in the SDLC.

  • Copilot Usage-Based Billing Gets a Token Dashboard

    Microsoft is keeping Visual Studio's new built-in Agent Skills switched off by default while a public dashboard measures whether their performance gains justify the additional tokens they may consume.

Subscribe on YouTube