This project is read-only.

Problem implementing IContent

Jul 23, 2013 at 9:43 PM
Dear all,

I am rather new to c#/WPF and Modern UI of course.

I'm having problems with implementing the IContent stuff, by searching these forums, I am this far: (I'm trying to catch the foo parameter)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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.Navigation;
using System.Windows.Shapes;
using FirstFloor.ModernUI.Windows;

namespace LoLSelector.Pages
{
    /// <summary>
    /// Interaction logic for champGuides.xaml
    /// </summary>
    public partial class champGuides : UserControl, IContent
    {
        public champGuides()
        {
            InitializeComponent();
        }

        public void OnFragmentNavigation(FragmentNavigationEventArgs e)
        {
            if (e.Fragment == "foo")
            {
                MessageBox.Show("TEST");
            }
        }
    }
}
The " public partial class champGuides : UserControl, IContent" creates an error (in german), roughly translated it says:
'LoLSelector.Pages.champGuides' does not implement the interface member 'FirstFloor.ModernUI.Windows.IContent.OnNavigatingFrom(FirstFloor.ModernUI.Windows.Navigation.NavigatingCancelEventArgs)'.

What am I missing? Please be generous, I'm totally new to that stuff! But I love the UI!
Jul 24, 2013 at 5:36 AM
PrimuS852, you must implement all the member functions of IContent Interface in order to remove the error, you can do this by right clicking IContent keyword in the class definition statement and click implement IContent or you can do it by manually writing following code in the class
public void OnFragmentNavigation(FirstFloor.ModernUI.Windows.Navigation.FragmentNavigationEventArgs e)
{
    //throw new NotImplementedException();
}

public void OnNavigatedFrom(FirstFloor.ModernUI.Windows.Navigation.NavigationEventArgs e)
{
    //throw new NotImplementedException();
}

public void OnNavigatedTo(FirstFloor.ModernUI.Windows.Navigation.NavigationEventArgs e)
{
       //throw new NotImplementedException();
}

public void OnNavigatingFrom(FirstFloor.ModernUI.Windows.Navigation.NavigatingCancelEventArgs e)
{
    //throw new NotImplementedException();
}
Jul 25, 2013 at 6:44 PM
Great, thank you so much! Easy explanation!