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

d2Liks

New Member
February 22, 2012
7
0
35
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
    45
    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
    35
    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
    45
    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
    45
    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
    35
    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

    Similar threads

    @doskabouter That fixed it, thanks!
    @doskabouter That fixed it, thanks!
    I just upgraded to 1.32 and now, when I start TV-Service Config, I get this error: [2024-01-31 09:33:13,138] [Log ] [SetupTv...
    Replies
    2
    Views
    557
    So far I needed to limit the media items to respect the token limit of ChatGPT. Now the complete media items can be used, because the movie list is splitted into chunks of a specified size and responses for each chunk are concentrated into the result list :) private async Task<string> GenerateResponseWithGPT(string searchQuery...
    So far I needed to limit the media items to respect the token limit of ChatGPT. Now the complete media items can be used, because...
    Hi, I'm planning to write a plugin for MediaPortal 2, that supports users to find the right media items with help of AI...
    Replies
    6
    Views
    958
    Good. I am pleased that that is now working for you. :) If you have ever looked at MP debug log files, you may have noticed that apparent errors are not rare, but these are "errors" that do not affect the functioning of the product. (It is not desirable to have these errors in the log file, as it misleads users, testers, and...
    Good. I am pleased that that is now working for you. :) If you have ever looked at MP debug log files, you may have noticed that...
    Hi, I am reinstalling MediaPortal 1.13 on a new W10 64Bit computer. In need to use this old version because of TVWishlist. So my...
    Replies
    10
    Views
    983
    MP1 MP2 [solved] EPG windows DE
    So, with your tips I've deep looking on the config program. And I've found the mapping for HID device. I've make the key config for up and down keys. And it's Work! Really big thanks to you and the team that give this great mediacenter. Cheers ;)
    So, with your tips I've deep looking on the config program. And I've found the mapping for HID device. I've make the key config for...
    Hello, How to scroll the line in the epg windows with titan extended skin? I see the firts 11 channel lines but I cannot get the...
    Replies
    3
    Views
    571
    Sums up the problem I am having. Sorry if I wasn't clear. No, #selectedthumb is not preserved on going to the next window. That's exactly what I am trying to solve. An example is moving from mytvrecordedtv.xml to mytvRecordedInfo. The variable changes from a screen grab thumbnail from the video file to a channel logo during...
    Sums up the problem I am having. Sorry if I wasn't clear. No, #selectedthumb is not preserved on going to the next window. That's...
    Good evening, I have a basic understanding of using skin.setstring and am able to set a skin property when a control gets focus...
    Replies
    2
    Views
    847
    Top Bottom