This project is read-only.

Dificulties in Making Work IContent

Jun 19, 2013 at 9:26 AM
Hi,

i´m trying to use iContent.

My Code:
MainWindow

<mui:LinkGroup DisplayName="testes">

    <mui:LinkGroup.Links>
        <mui:Link DisplayName="Teste Pdf" Source="pdf/visualizador_pdf.xaml#1" />
    </mui:LinkGroup.Links>

</mui:LinkGroup>
visualizador_pdf.xaml
<UserControl x:Class="CalculoPrecosTransferes.Pdf.visualizador_pdf"
             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:mui="http://firstfloorsoftware.com/ModernUI"
             mc:Ignorable="d" 
             d:DesignHeight="800" d:DesignWidth="800">
    <Grid>

        <mui:ModernFrame x:Name="Frame"/>

    </Grid>
</UserControl>
visualizador_pdf.xaml.cs
using FirstFloor.ModernUI.Windows.Navigation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace CalculoPrecosTransferes.Pdf
{
    public interface IContent
    {
        void OnFragmentNavigation(FragmentNavigationEventArgs e);
        void OnNavigatedFrom(NavigationEventArgs e);
        void OnNavigatedTo(NavigationEventArgs e);
        void OnNavigatingFrom(NavigatingCancelEventArgs e);
    }

    /// <summary>
    /// Interaction logic for Visualizador_PDFs.xaml
    /// </summary>
    public partial class visualizador_pdf : UserControl, IContent
    {
        public visualizador_pdf()
        {
            InitializeComponent();
        }

        public void OnFragmentNavigation(FragmentNavigationEventArgs e)
        {
            MessageBox.Show(e.Fragment);

            MessageBox.Show("OLá");
        }
        public void OnNavigatedFrom(NavigationEventArgs e)
        {
            
        }
        public void OnNavigatedTo(NavigationEventArgs e)
        {
            MessageBox.Show("OLá");
        }
        public void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            MessageBox.Show("OLá");
        }
        
    }
}
The events don´t "fire" ... What i am doing wrong?

Please help.

TIA

Baltazar

(Modern UI 1.0.4)
Jun 19, 2013 at 9:01 PM
You have to implement the already existing interface FirstFloor.ModernUI.Windows.IContent. You implemented a different one.
Jun 20, 2013 at 9:36 AM
Thanks a Lot. It working.