Skip to content
Roman Shapiro edited this page Nov 9, 2020 · 12 revisions

MML(Myra Markup Language) is XML based declarative language to describe UI.

I.e. following MML is equivalent to the UI from Quick Start Tutorial:

<Project>
  <Grid ColumnSpacing="8" RowSpacing="8" >
    <Grid.ColumnsProportions>
      <Proportion/>
      <Proportion/>
    </Grid.ColumnsProportions>
    <Grid.RowsProportions>
      <Proportion/>
      <Proportion/>
    </Grid.RowsProportions>
    <Label Id="label" Text="Hello, World!" />
    <ComboBox GridColumn="1" >
      <ListItem Text="Red" Color="#FF0000FF" />
      <ListItem Text="Green" Color="#008000FF" />
      <ListItem Text="Blue" Color="#0000FFFF" />
    </ComboBox>
    <Button Text="Show" GridRow="1" />
    <SpinButton Nullable="True" Width="100" GridColumn="1" GridRow="1" />
  </Grid>
</Project>

".xmmp" is preferred extension for files with MML.

Following code loads Project from MML:

string data = File.ReadAllText(filePath);
Project project = Project.LoadFromXml(data);

Following code saves it:

string data = project.Save();	
File.WriteAllText(filePath, data);	

Following code could be used to obtain reference to the element by id:

Label label = (Label) project.Root.FindWidgetById("label");

Clone this wiki locally