This project is read-only.

Configuration Window does not show up

Jun 9, 2012 at 6:03 PM

Hey Mayhem Team,

I'm following the documentation on how to create a Configuration PopUp. However the following code won't show up. The reaction is in the list, but the configuration control is not recognized and not shown.

The main reaction

    [DataContract]
    [MayhemModule("SendMidi", "Send a specified midi message to a device")]
    public class MidiSend : ReactionBase
    {
        OutputDevice device;


        public MidiSend()
        {
        }

        public override void Perform()
        {
        }

        public WpfConfiguration ConfigurationControl
        {
            get
            {
                return new PopupConfig();
            }
        }

        public void OnSaved(WpfConfiguration ConfigurationControl)
        {

        }
    }

 

The control XAML

<src:WpfConfiguration x:Class="MayhemMidi.PopupConfig"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:src="clr-namespace:MayhemWpf.UserControls;assembly=MayhemWpf"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="400">
    <Grid>
		<Grid.ColumnDefinitions>

            <ColumnDefinition Width="100" />

            <ColumnDefinition MinWidth="300" />

        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>

            <RowDefinition Height="20" />

        </Grid.RowDefinitions>
        
        <TextBlock Style="{StaticResource ConfigLabel}"  Grid.Column="0" Grid.Row="0">Midi Device:</TextBlock>
        <ComboBox Name="OutputDevice" Grid.Column="1" Grid.Row="0" SelectedValuePath="Key" DisplayMemberPath="Value" />
        
    </Grid>
</src:WpfConfiguration>

And the code behind

    public partial class PopupConfig : MayhemWpf.UserControls.WpfConfiguration
    {
        public String DeviceName = "";

        public PopupConfig()
        {
            InitializeComponent();
            OutputDevice.ItemsSource = MidiManager.MidiManager.GetOutputDevices();
        }

        public override string Title
        {
            get
            {
                return "Configurate Midi";
            }
        }

        public override void OnLoad()
        {
            base.OnLoad();
        }
    }

Am I doing something wrong? Also, could link to the demo reaction created in the documentation? I think this would be helpful.

 

Regards

Chris