Giter Site home page Giter Site logo

windows-desktop-iptv-app's People

Contributors

yjinhyuk avatar

Watchers

 avatar  avatar

windows-desktop-iptv-app's Issues

Binding StackPanel and child items in viewmodel

My project is Micro Caliburn WPF Project.

I want to bind StackPanel in ViewModel from View.

<UserControl x:Class="WinIPTVApp.Pages.Content.Views.HomeView"
             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:local="clr-namespace:WinIPTVApp.Pages.Content.Views"
             mc:Ignorable="d" 
             d:DesignHeight="1080" d:DesignWidth="1920">
    <Grid>
            <ScrollViewer 
                x:Name="Navigation_Pane" Grid.Row="1" VerticalAlignment="Center" 
                HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled" >
                <StackPanel x:Name="Menus" VerticalAlignment="Center" Background="Transparent" />
            </ScrollViewer>
    </Grid>
</UserControl>
public partial class HomeView : UserControl
    {
        public HomeView()
        {
            InitializeComponent();

            var homeMenuHeader = new List<SubItem>();
            homeMenuHeader.Add(new SubItem("Customer"));
            var item0 = new MenuItemViewModel("Menu0", homeMenuHeader, "home", 0);

            var liveMenuHeader = new List<SubItem>();
            liveMenuHeader.Add(new SubItem("Services"));
            var item1 = new MenuItemViewModel("Menu1", liveMenuHeader, "monitor", 1);

            var movieMenuHeader = new List<SubItem>();
            movieMenuHeader.Add(new SubItem("Customers"));
            movieMenuHeader.Add(new SubItem("Providers"));
            var item2 = new MenuItemViewModel("Menu2", movieMenuHeader, "movie", 2);
            var serieMenuHeader = new List<SubItem>();
            serieMenuHeader.Add(new SubItem("Customer"));
            serieMenuHeader.Add(new SubItem("Providers"));
            var item3 = new MenuItemViewModel("t v s e r i e s", serieMenuHeader, "tv_series", 3);

            Menus.Children.Add(new MenuItemView(item0));
            Menus.Children.Add(new MenuItemView(item1));
            Menus.Children.Add(new MenuItemView(item2));
            Menus.Children.Add(new MenuItemView(item3));
        }
// I should defind this method in viewmodel 
        public void setDefault()
        {
            Menus.get(0).Index = 2;
        }
    }
public class MenuItemViewModel
    {
        public MenuItemViewModel(string header, List<SubItem> subItems, string icon, int index)
        {
            Header = header;
            SubItems = subItems;
            Icon = icon;
            Index = index;
        }

        public MenuItemViewModel(string header, UserControl screen, string icon, int index)
        {
            Header = header;
            Screen = screen;
            Icon = icon;
            Index = index;
        }

        public string Header { get; private set; }
        public string Icon { get; private set; }
        public List<SubItem> SubItems { get; private set; }
        public int Index { get; private set; }
        public UserControl Screen { get; private set; }
    }
<Grid HorizontalAlignment="Left" Margin="0 0 0 36">
        <StackPanel Orientation="Horizontal" Width="280" UIElement.PreviewMouseDown="StackPanel_PreviewMouseDown">
            <Image x:Name="Icon" Margin="30 0 0 0" Stretch="None"/>
            <ListBoxItem x:Name="ListViewItemMenu" Content="{Binding Path=Header}" 
                         Typography.Capitals="AllSmallCaps" Typography.CapitalSpacing="True" FontWeight="Light"
                         VerticalAlignment="Center" FontSize="20" Foreground="{DynamicResource gray}"
                         ScrollViewer.HorizontalScrollBarVisibility="Disabled" Margin="22 0 0 0" />
            <Expander x:Name="ExpanderMenu" Header="{Binding Path=Header}" Typography.Capitals="AllSmallCaps" 
                      IsExpanded="False" VerticalAlignment="Top" FontSize="20"  Foreground="{DynamicResource gray}"
                      Margin="26 0 0 0" Style="{DynamicResource NoToggleButtonExpander}" FontWeight="Light">
                <ListView x:Name="ListViewMenu" ItemsSource="{Binding Path=SubItems}" 
                          Background="Transparent" HorizontalContentAlignment="Left" VerticalContentAlignment="Bottom"
                          BorderBrush="Transparent" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=Name}" 
                                       Typography.Capitals="AllSmallCaps" Margin="0,0,250,0" />
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
            </Expander>
        </StackPanel>
    </Grid>

I am going to use Menus -> Stack Panel in HomeViewModel and define the SetDefault() Method in ViewModel

Add JWTs Authentication into app for custom Login

I am going to make the JWTs Authentication into our app.

This needs to go to "Select User" Page when user logged in already.
So they don't need to go to login page again if he already logged in before.

Also, they should go to login again when app has updated while they didn't turn on the app or they didn't open app for a while.

So this app should get authentication security also.

  1. I just make the global settings and global app local storage but I think this is not good ways to keep this.
    So I am going to make the local database which store the current user and favorite channels or movies or recommended
    Live TV .
  2. Make the txt file or temp file which store above ones.

Please let me know which one is good for our app or big scale app. Because our app should be updated and on big-demand project.

I hope to get answer from you. What is the best choose from you?

Thank you for your helps in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.