Skip to content

Commit

Permalink
Add Ribbon menu (#160)
Browse files Browse the repository at this point in the history
* Add Ribbon menu

* Clean-up code

* Added Missing reference to Messaging.Core

* Removed unnecessary assembly

* Clean-up
  • Loading branch information
kruplm authored Feb 24, 2023
1 parent 08c19f8 commit 9c1d29a
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 25 deletions.
56 changes: 33 additions & 23 deletions Tryouts/Prototypes/Shell/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,42 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
See the License for the specific language governing permissions and limitations under the License.
********************************************************************************************************
-->

<Window x:Class="Shell.MainWindow"
<RibbonWindow x:Class="Shell.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Shell"
mc:Ignorable="d"
Title="Compose" Height="450" Width="800">
<DockPanel Background="#002B51">
<Label DockPanel.Dock="Top" Foreground="White" FontSize="20">Hello Compose!</Label>
<ItemsControl ItemsSource="{Binding}" BorderThickness="0">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button
HorizontalAlignment="Center"
DockPanel.Dock="Right" Click="ShowChild_Click"
Content="{Binding AppName}"
Background="#FFF2F2F2"
Padding="5"
Margin="20"
Height="40"
/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" HorizontalAlignment="Center"></StackPanel>
</DockPanel>
</Window>
Title="Compose" Height="450" Width="600">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Ribbon x:Name="Ribbon" SelectedIndex="0" Height="Auto" >
<!-- Hide the Application Menu -->
<Ribbon.ApplicationMenu>
<RibbonApplicationMenu Visibility="Collapsed">
</RibbonApplicationMenu>
</Ribbon.ApplicationMenu>
<!-- Ribbon Tab #1: Modules -->
<RibbonTab Header="Modules" HorizontalAlignment="Left" Height="Auto" VerticalAlignment="Top">
<RibbonGroup x:Name="Modules" Header="Modules" Height="Auto" ItemsSource="{Binding}">
<RibbonGroup.ItemTemplate>
<DataTemplate>
<RibbonButton
VerticalAlignment="Top"
HorizontalAlignment="Right"
Click="ShowChild_Click"
Label="{Binding AppName}"
Padding="5"
Margin="5"
Height="40"
/>
</DataTemplate>
</RibbonGroup.ItemTemplate>
</RibbonGroup>
</RibbonTab>
</Ribbon>
</Grid>
</RibbonWindow>
17 changes: 15 additions & 2 deletions Tryouts/Prototypes/Shell/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,31 @@
// * and limitations under the License.
// */

using Manifest;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using Manifest;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Controls.Ribbon;

namespace Shell
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
public partial class MainWindow : RibbonWindow
{
internal List<WebWindow> webWindows { get; set; } = new List<WebWindow>();
private ManifestModel config;
Expand Down
6 changes: 6 additions & 0 deletions Tryouts/Prototypes/Shell/Shell.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shell", "Shell.csproj", "{E
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MorganStanley.ComposeUI.Messaging.Server", "..\..\Messaging\Server\MorganStanley.ComposeUI.Messaging.Server.csproj", "{9E6E9B3C-4BD0-4B1E-852E-0B2164D72C2F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MorganStanley.ComposeUI.Messaging.Core", "..\..\Messaging\Core\MorganStanley.ComposeUI.Messaging.Core.csproj", "{3ED32A3C-7958-4A83-8BB2-DD71528FAA17}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -21,6 +23,10 @@ Global
{9E6E9B3C-4BD0-4B1E-852E-0B2164D72C2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E6E9B3C-4BD0-4B1E-852E-0B2164D72C2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E6E9B3C-4BD0-4B1E-852E-0B2164D72C2F}.Release|Any CPU.Build.0 = Release|Any CPU
{3ED32A3C-7958-4A83-8BB2-DD71528FAA17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3ED32A3C-7958-4A83-8BB2-DD71528FAA17}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3ED32A3C-7958-4A83-8BB2-DD71528FAA17}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3ED32A3C-7958-4A83-8BB2-DD71528FAA17}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 9c1d29a

Please sign in to comment.