Noob helps - Thanks

Topics: Prism v4 - WPF 4
Nov 3, 2011 at 5:24 PM

Very good and thanks for reading.

I'm adding Prism with Fluent. This is the code:

code shel

<Fluent:RibbonWindow x:Class="Cocina.Shel"

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent"

        xmlns:rgn ="clr-namespace:Microsoft.Practices.Prism.Regions;assembly=Microsoft.Practices.Prism"       

        Title="MainWindow" Background="#FFEBEDF0" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="350" Width="450">

    <Fluent:RibbonWindow.Resources>

        <ResourceDictionary Source="/Cocina;component/PersonTemplate.xaml"/>

    </Fluent:RibbonWindow.Resources>

    <DockPanel LastChildFill="True">

        <Fluent:Ribbon DockPanel.Dock="Top">

            <!--Quick Access Toolbar Items-->

            <Fluent:Ribbon.QuickAccessItems>

                <Fluent:QuickAccessMenuItem Target="{Binding ElementName=buttonGreen}"/>

            </Fluent:Ribbon.QuickAccessItems>

 

            <!--Tabs-->

            <Fluent:RibbonTabItem Header="Tab" ReduceOrder="(P),(P),(P),(P),(P)">

                <Fluent:RibbonGroupBox Header="Add / Remove">

                    <!--

                    <Fluent:Button Header="Add" Command="{Binding CreateCommand}" Icon="Images\Green.png" LargeIcon="Images\GreenLarge.png" Name="buttonGreen"/>

                    -->

                    <Fluent:Button Header="Add" Command="{Binding CreateCommand}" Icon="/Cocina;component/_5Images/ImagesFluentRibbon/Green.png" LargeIcon="/Cocina;component/_5Images/ImagesFluentRibbon/GreenLarge.png" Name="buttonGreen"/>

                    <Fluent:Button Header="Remove" Command="{Binding DeleteCommand}" Icon="/Cocina;component/_5Images/Gray.png" LargeIcon="/Cocina;component/_5Images/ImagesFluentRibbon/GrayLarge.png" />

                </Fluent:RibbonGroupBox>

                <!--Gallery with all persons-->

                <Fluent:RibbonGroupBox Header="All Persons" Name="P">

                    <Fluent:InRibbonGallery ItemWidth="100" ItemHeight="56" ResizeMode="Both"

                                      MinItemsInRow="2" MaxItemsInRow="7"

 

                                      ItemTemplate="{DynamicResource PersoneCardTemplate}"

                                      ItemsSource="{Binding Persons}"

                                      SelectedItem="{Binding Current}">

                    </Fluent:InRibbonGallery>

                </Fluent:RibbonGroupBox>

            </Fluent:RibbonTabItem>

 

            <!--Backstage Items-->

            <Fluent:Ribbon.Menu>

                <Fluent:Backstage>

                    <Fluent:BackstageTabControl>

                        <Fluent:Button Header="Close" Command="{Binding ExitCommand}" Icon="/WpfApplication5;component/Images/Blue.png"/>

                    </Fluent:BackstageTabControl>

                </Fluent:Backstage>

            </Fluent:Ribbon.Menu>

        </Fluent:Ribbon>

        <ContentControl rgn:RegionManager.RegionName="RegionCentro" Margin="0,0,49,200" Width="428" Grid.ColumnSpan="2" Height="169" />

        <!--View & Edit Current Persone Details-->

 

    </DockPanel>

</Fluent:RibbonWindow>

 

code  Mymodule

 

.....

regionManager.RegisterViewWithRegion("RegionCentro", () => container.Resolve<PruebaView>());

....

 

code BootstrapperGestionAplicacion

 

namespace Cocina

{

    public class BootstrapperGestionAplicacion : UnityBootstrapper

    {

        protected override DependencyObject CreateShell()

        {

            return ServiceLocator.Current.GetInstance<Shel>();

        }

 

        protected override void InitializeShell()

        {

            base.InitializeShell();

 

            Application.Current.MainWindow = (Shel)this.Shell;

            Application.Current.MainWindow.Show();

        }

 

        protected override void ConfigureModuleCatalog()

        {

            base.ConfigureModuleCatalog();

            ModuleCatalog catalog = (ModuleCatalog)this.ModuleCatalog;

            catalog.AddModule(typeof(MyModule));

        }

    }

}

 

code userControl

 

<UserControl x:Class="Cocina.PruebaView"

             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"

             mc:Ignorable="d"

             d:DesignHeight="300" d:DesignWidth="300">

    <Grid>

        <Label Content="PRUEBA" Height="28" HorizontalAlignment="Left" Margin="116,110,0,0" Name="label1" VerticalAlignment="Top" />

    </Grid>

</UserControl>

 



I do not know why I do not see the control in the region, does not fail, butdo not see it.

Thank you very much for trying to help and receives a warm greeting

Nov 3, 2011 at 5:32 PM

Sorry absolute position has killed me the code if it works.


A warm greeting.

Developer
Nov 4, 2011 at 5:55 PM

Hi,

I'm glad that you have found a solution to your problem; thanks for sharing this with the rest of the community.

Regards,

Damian Cherubini
http://blogs.southworks.net/dcherubini