<?xml version="1.0" encoding="utf-8"?>
<Application
  Name="LightSwitchApplication.HowTo" xmlns="http://schemas.microsoft.com/LightSwitch/2010/xaml/model">
  <Application.Attributes>
    <Partial />
  </Application.Attributes>
  <Screen
    Name="GridEditingRow">
    <Screen.Attributes>
      <SaveChangesTo
        EntityContainer="NorthwindData" />
      <DisplayName
        Value="GRID: Editing (Row)" />
    </Screen.Attributes>
    <Screen.RootContentItem>
      <ContentItem
        Name="RootContentItem"
        Kind="Screen"
        View="Microsoft.LightSwitch.MobileWeb:Screen">
        <ContentItem
          Name="Tabs"
          Kind="Group"
          View="Microsoft.LightSwitch.MobileWeb:TabPages">
          <ContentItem
            Name="Product List"
            Kind="Group">
            <ContentItem
              Name="WijmoGrid"
              Kind="Collection"
              DataType="CollectionView$Product"
              View="Wijmo.LightSwitch:CollectionCustomControl">
              <ContentItem.DataSource>
                <ScreenExpressionTree>
                  <ChainExpression>
                    <MemberExpression
                      Member="GridEditingRow/Properties[Products]" />
                  </ChainExpression>
                </ScreenExpressionTree>
              </ContentItem.DataSource>
              <ContentItem
                Name="RowTemplate"
                Kind="Details"
                DataType="Product">
                <ContentItem.DataSource>
                  <ScreenExpressionTree>
                    <ChainExpression />
                  </ScreenExpressionTree>
                </ContentItem.DataSource>
                <ContentItem
                  Name="ProductName"
                  Kind="Value"
                  DataType=":String">
                  <ContentItem.DataSource>
                    <ScreenExpressionTree>
                      <ChainExpression>
                        <MemberExpression
                          Member="Product/Properties[ProductName]" />
                      </ChainExpression>
                    </ScreenExpressionTree>
                  </ContentItem.DataSource>
                </ContentItem>
                <ContentItem
                  Name="QuantityPerUnit"
                  Kind="Value"
                  DataType=":String?">
                  <ContentItem.DataSource>
                    <ScreenExpressionTree>
                      <ChainExpression>
                        <MemberExpression
                          Member="Product/Properties[QuantityPerUnit]" />
                      </ChainExpression>
                    </ScreenExpressionTree>
                  </ContentItem.DataSource>
                </ContentItem>
                <ContentItem
                  Name="UnitPrice"
                  Kind="Value"
                  DataType=":Decimal?">
                  <ContentItem.DataSource>
                    <ScreenExpressionTree>
                      <ChainExpression>
                        <MemberExpression
                          Member="Product/Properties[UnitPrice]" />
                      </ChainExpression>
                    </ScreenExpressionTree>
                  </ContentItem.DataSource>
                </ContentItem>
                <ContentItem
                  Name="UnitsInStock"
                  Kind="Value"
                  DataType=":Int16?">
                  <ContentItem.DataSource>
                    <ScreenExpressionTree>
                      <ChainExpression>
                        <MemberExpression
                          Member="Product/Properties[UnitsInStock]" />
                      </ChainExpression>
                    </ScreenExpressionTree>
                  </ContentItem.DataSource>
                </ContentItem>
                <ContentItem
                  Name="UnitsOnOrder"
                  Kind="Value"
                  DataType=":Int16?">
                  <ContentItem.DataSource>
                    <ScreenExpressionTree>
                      <ChainExpression>
                        <MemberExpression
                          Member="Product/Properties[UnitsOnOrder]" />
                      </ChainExpression>
                    </ScreenExpressionTree>
                  </ContentItem.DataSource>
                </ContentItem>
                <ContentItem
                  Name="ReorderLevel"
                  Kind="Value"
                  DataType=":Int16?">
                  <ContentItem.DataSource>
                    <ScreenExpressionTree>
                      <ChainExpression>
                        <MemberExpression
                          Member="Product/Properties[ReorderLevel]" />
                      </ChainExpression>
                    </ScreenExpressionTree>
                  </ContentItem.DataSource>
                </ContentItem>
                <ContentItem
                  Name="Discontinued"
                  Kind="Value"
                  DataType=":Boolean">
                  <ContentItem.DataSource>
                    <ScreenExpressionTree>
                      <ChainExpression>
                        <MemberExpression
                          Member="Product/Properties[Discontinued]" />
                      </ChainExpression>
                    </ScreenExpressionTree>
                  </ContentItem.DataSource>
                </ContentItem>
                <ContentItem
                  Name="Category"
                  Kind="Details"
                  DataType="Category">
                  <ContentItem.DataSource>
                    <ScreenExpressionTree>
                      <ChainExpression>
                        <MemberExpression
                          Member="Product/Properties[Category]" />
                      </ChainExpression>
                    </ScreenExpressionTree>
                  </ContentItem.DataSource>
                  <ContentItem
                    Name="RowTemplate1"
                    Kind="Details"
                    DataType="Category">
                    <ContentItem.DataSource>
                      <ScreenExpressionTree>
                        <ChainExpression />
                      </ScreenExpressionTree>
                    </ContentItem.DataSource>
                  </ContentItem>
                </ContentItem>
                <ContentItem
                  Name="Supplier"
                  Kind="Details"
                  DataType="Supplier">
                  <ContentItem.DataSource>
                    <ScreenExpressionTree>
                      <ChainExpression>
                        <MemberExpression
                          Member="Product/Properties[Supplier]" />
                      </ChainExpression>
                    </ScreenExpressionTree>
                  </ContentItem.DataSource>
                  <ContentItem
                    Name="RowTemplate2"
                    Kind="Details"
                    DataType="Supplier">
                    <ContentItem.DataSource>
                      <ScreenExpressionTree>
                        <ChainExpression />
                      </ScreenExpressionTree>
                    </ContentItem.DataSource>
                  </ContentItem>
                </ContentItem>
                <ContentItem.PropertySources>
                  <ControlPropertySource
                    Property="Microsoft.LightSwitch.MobileWeb:RootControl/Properties[Tap]">
                    <ScreenExpressionTree>
                      <ChainExpression>
                        <CallExpression
                          Target="!module/Methods[showAddEditProduct]">
                          <CallExpression.Attributes>
                            <AssociatedCollection
                              Collection="GridEditingRow/Properties[Products]" />
                          </CallExpression.Attributes>
                          <ArgumentExpression
                            Parameter="Product">
                            <ChainExpression>
                              <MemberExpression
                                Member="GridEditingRow/Properties[Products]" />
                              <MemberExpression
                                Member="selectedItem" />
                            </ChainExpression>
                          </ArgumentExpression>
                        </CallExpression>
                      </ChainExpression>
                    </ScreenExpressionTree>
                  </ControlPropertySource>
                </ContentItem.PropertySources>
              </ContentItem>
            </ContentItem>
            <ContentItem.CommandItems>
              <ContentItem
                Name="AddNew"
                Kind="Command">
                <ContentItem.Attributes>
                  <DisplayName
                    Value="Add" />
                </ContentItem.Attributes>
                <ContentItem.PropertySources>
                  <ControlPropertySource
                    Property="Microsoft.LightSwitch.MobileWeb:RootControl/Properties[Tap]">
                    <ScreenExpressionTree>
                      <ChainExpression>
                        <CallExpression
                          Target="GridEditingRow/Methods[AddNew]" />
                      </ChainExpression>
                    </ScreenExpressionTree>
                  </ControlPropertySource>
                  <ControlPropertySource
                    Property="Microsoft.LightSwitch.MobileWeb:RootCommand/Properties[HiddenIfDisabled]">
                    <ScreenExpressionTree>
                      <ChainExpression>
                        <ConstantExpression
                          Value="False"
                          ResultType=":Boolean" />
                      </ChainExpression>
                    </ScreenExpressionTree>
                  </ControlPropertySource>
                  <ControlPropertySource
                    Property="Microsoft.LightSwitch.MobileWeb:RootCommand/Properties[Icon]">
                    <ScreenExpressionTree>
                      <ChainExpression>
                        <ConstantExpression
                          Value="msls-add"
                          ResultType=":String" />
                      </ChainExpression>
                    </ScreenExpressionTree>
                  </ControlPropertySource>
                </ContentItem.PropertySources>
              </ContentItem>
              <ContentItem
                Name="DeleteSelected"
                Kind="Command">
                <ContentItem.Attributes>
                  <DisplayName
                    Value="Delete" />
                </ContentItem.Attributes>
                <ContentItem.PropertySources>
                  <ControlPropertySource
                    Property="Microsoft.LightSwitch.MobileWeb:RootControl/Properties[Tap]">
                    <ScreenExpressionTree>
                      <ChainExpression>
                        <CallExpression
                          Target="GridEditingRow/Methods[DeleteSelected]" />
                      </ChainExpression>
                    </ScreenExpressionTree>
                  </ControlPropertySource>
                  <ControlPropertySource
                    Property="Microsoft.LightSwitch.MobileWeb:RootCommand/Properties[HiddenIfDisabled]">
                    <ScreenExpressionTree>
                      <ChainExpression>
                        <ConstantExpression
                          Value="False"
                          ResultType=":Boolean" />
                      </ChainExpression>
                    </ScreenExpressionTree>
                  </ControlPropertySource>
                  <ControlPropertySource
                    Property="Microsoft.LightSwitch.MobileWeb:RootCommand/Properties[Icon]">
                    <ScreenExpressionTree>
                      <ChainExpression>
                        <ConstantExpression
                          Value="msls-trash"
                          ResultType=":String" />
                      </ChainExpression>
                    </ScreenExpressionTree>
                  </ControlPropertySource>
                </ContentItem.PropertySources>
              </ContentItem>
            </ContentItem.CommandItems>
          </ContentItem>
        </ContentItem>
        <ContentItem
          Name="Popups"
          Kind="Group"
          View="Microsoft.LightSwitch.MobileWeb:DialogPages" />
        <ContentItem.PropertySources>
          <ControlPropertySource
            Property="Microsoft.LightSwitch.MobileWeb:Screen/Properties[ScreenType]">
            <ScreenExpressionTree>
              <ChainExpression>
                <ConstantExpression
                  Value="Edit"
                  ResultType=":String" />
              </ChainExpression>
            </ScreenExpressionTree>
          </ControlPropertySource>
        </ContentItem.PropertySources>
      </ContentItem>
    </Screen.RootContentItem>
    <Screen.Methods>
      <ScreenMethod
        Name="showTab">
        <ScreenMethod.Attributes>
          <DisplayMethodByDefault
            Display="True" />
          <Generated />
        </ScreenMethod.Attributes>
        <ScreenMethodParameter
          Name="tabName"
          ParameterType=":String" />
      </ScreenMethod>
      <ScreenMethod
        Name="showDialog">
        <ScreenMethod.Attributes>
          <DisplayMethodByDefault
            Display="True" />
          <Generated />
        </ScreenMethod.Attributes>
        <ScreenMethodParameter
          Name="dialogName"
          ParameterType=":String" />
      </ScreenMethod>
      <ScreenMethod
        Name="AddNew" />
      <ScreenMethod
        Name="DeleteSelected" />
    </Screen.Methods>
    <Screen.Properties>
      <ScreenCollectionProperty
        Name="Products"
        PageSize="45"
        PropertyType="CollectionView$Product">
        <ScreenCollectionProperty.Query>
          <ScreenQueryDefinition
            Name="ProductsQuery"
            ReturnType="Product*">
            <ScreenQueryDefinition.FilterExpression>
              <QueryFilterExpressionTree />
            </ScreenQueryDefinition.FilterExpression>
            <ScreenQueryDefinition.Source>
              <QuerySourceExpressionTree>
                <MemberExpression
                  Member="NorthwindData/Members[Products]" />
              </QuerySourceExpressionTree>
            </ScreenQueryDefinition.Source>
          </ScreenQueryDefinition>
        </ScreenCollectionProperty.Query>
        <ScreenExpressionTree>
          <ChainExpression>
            <CallExpression
              Target="GridEditingRow/Properties[Products]/Query" />
          </ChainExpression>
        </ScreenExpressionTree>
      </ScreenCollectionProperty>
    </Screen.Properties>
  </Screen>
  <Application.Methods>
    <ApplicationMethod
      Name="showGridEditingRow">
      <ApplicationMethod.Attributes>
        <ShowScreenMethod
          TargetScreen="GridEditingRow" />
      </ApplicationMethod.Attributes>
    </ApplicationMethod>
  </Application.Methods>
</Application>