The problem with using the controls in the skin (1 Viewer)

d2Liks

New Member
February 22, 2012
7
0
37
Home Country
Ukraine Ukraine
How to use in the MediaPortal in the skin listbox control?
How do I use to bind to the listview? These do not appear in it.
 

Albert

MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    46
    Freiburg im Breisgau, Germany
    Home Country
    Germany Germany
    I don't understand your question.
    To learn about data binding, you can read http://msdn.microsoft.com/en-us/library/ms752347.aspx
    To bind a ListView to underlaying data, you need a data model.
    You can look into the screens of the default skin to see how we use the ListView. Look into the code of the referenced models to see how a model is written.
     

    d2Liks

    New Member
    February 22, 2012
    7
    0
    37
    Home Country
    Ukraine Ukraine
    <Include.Resources>
    <!-- Header -->
    <Model x:Key="Model" Id="5726DA5A-70D5-458f-AF67-611293D97912"/>
    <DockPanel Context="{Model Id=5726DA5A-70D5-458f-AF67-611293D97912}" LastChildFill="False">

    <ListView Width="200" Height="300"
    x:Name="Menu"
    DataContext="{Binding Source={StaticResource Model}}"
    ItemsSource="{Binding GetContacts}"
    Style="{ThemeResource ContentsMenuListViewStyle}">

    </ListView>

    </DockPanel>
    </ControlTemplate>

    </Include.Resources>
    </Include>

    Hi, my problem is that accessor get function in GetContacts property works correctly but ListView still doesn't show anything. Where is the problem here?

    Here is how implemented my property:

    private ItemsList _listContacts=null;
    public ItemsList GetContacts
    {
    get
    {
    return _listContacts;
    }
    set
    {
    if (_listContacts == value) return;
    _listContacts = value;
    OnPropertyChanged("GetContacts");
    }
    }
     

    Albert

    MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    46
    Freiburg im Breisgau, Germany
    Home Country
    Germany Germany
    That seems well, as far as I can see.
    One of Context/DataContext is obsolete in your example, they both assign the same data context and it is inherited to child elements.

    Is the model you're using registered in the plugin.xml file?
    Which items are in the ItemsList which is returned by GetContacts? Btw, you should name the property Contacts, not GetContacts.
     

    Albert

    MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    46
    Freiburg im Breisgau, Germany
    Home Country
    Germany Germany
    Oh, I missed something: Your DockPanel doesn't contain a key. I guess you're using one of the templates master_bare or master_menu for your include. Depending on that template, you must assign an appropriate key to your DockPanel, see the description in the template screen you're using.
     

    d2Liks

    New Member
    February 22, 2012
    7
    0
    37
    Home Country
    Ukraine Ukraine
    Could you give an example of adding rows to ListView (how to implement String property which is linked to itemsSource ListView). This property returns a list of simple strings.

    I would like to ask few more questions.

    How do I make property password in MediaPortal2 to keep data secret while entering the text into textBox like in WPF PasswordBox ?

    How do I implement Visible property correctly? If I make property for texBox this way it will be ignored.

    private AbstractProperty _registrContentVisibility;

    public Plugin()
    {
    _registrContentVisibility = new WProperty(typeof(Visibility), null);
    RegistrContentVisibility = Visibility.Collapsed;
    }

    public AbstractProperty RegistrContentVisibilityProperty
    {
    get { return _registrContentVisibility; }
    }

    public Visibility RegistrContentVisibility
    {
    get { return (Visibility)_registrContentVisibility.GetValue(); }
    set { _registrContentVisibility.SetValue(value); }
    }


    <TextBox Visibility="{Binding Path= RegistrContentVisibility , Mode=TwoWay}">
     

    Users who are viewing this thread


    Write your reply...

    Similar threads

    Nice finding! (y)(y)(y) Adapted to new DWHD and PVHD ;) Position is in front of category bar ;)
    Nice finding! (y)(y)(y) Adapted to new DWHD and PVHD ;) Position is in front of category bar ;)
    This thread is intended for skin authors, plus those advanced users who have learnt skin programming and have customised the skins...
    Replies
    1
    Views
    992
    Well, I had already recognized your problem, but I still wanted to point out the basic connections once again. Unfortunately, I don't have a fundamentally different solution for you, but with this approach you should achieve your goal. ;) The idea of first setting the current genre colors with the defines is certainly a good one, as...
    Well, I had already recognized your problem, but I still wanted to point out the basic connections once again. Unfortunately, I...
    Good afternoon, Does anyone know a way of referencing the genre colour of the currently selected item in the TV Guide. We are all...
    Replies
    4
    Views
    656
    Attached are new TV service logs with your latest DLL. I see lots of EPG events and none of the messages from earlier. Congratulations!
    Attached are new TV service logs with your latest DLL. I see lots of EPG events and none of the messages from earlier. Congratulations!
    I have some weird behavior trying to operate the MP GUI in a new installation of MP 1.36 under Windows 11 Pro. Some of the remote...
    Replies
    33
    Views
    3K
    How do you add a new selection to the TV Guide Rows option in the BasicHome Editor in DWHD? Id like to add an option for 8 Rows. Which xmls should I be looking at to change.? Thanks!
    How do you add a new selection to the TV Guide Rows option in the BasicHome Editor in DWHD? Id like to add an option for 8 Rows...
    How do you add a new selection to the TV Guide Rows option in the BasicHome Editor in DWHD? Id like to add an option for 8 Rows...
    Replies
    0
    Views
    394
    It is present, but not with that name. It is called Scheduler, viz: Interesting. I had never noticed that when the "command" is "ACTION", the "cmdproperty" is the actual window id, but it makes sense that it is. Try this for yourself. First backup your working profile for the remote, then in the "Mapping" panel make a change to...
    It is present, but not with that name. It is called Scheduler, viz: Interesting. I had never noticed that when the "command" is...
    I would like to be able to go directly to the Scheduled recordings window without having to first go to the home menu. I saw this...
    Replies
    1
    Views
    287
    Top Bottom