yjinhyuk / windows-desktop-iptv-app Goto Github PK
View Code? Open in Web Editor NEWWindows Desktop Application Platform for IPTV
License: GNU General Public License v3.0
Windows Desktop Application Platform for IPTV
License: GNU General Public License v3.0
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
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.