Skip to content

Commit 5b5c308

Browse files
committed
Add LIFF Manager (WPF Application)
1 parent 8fb2c89 commit 5b5c308

14 files changed

+686
-0
lines changed

LiffManager/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
5+
</startup>
6+
</configuration>

LiffManager/App.xaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Application x:Class="LiffManager.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:LiffManager"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
8+
</Application.Resources>
9+
</Application>

LiffManager/App.xaml.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Configuration;
4+
using System.Data;
5+
using System.Linq;
6+
using System.Threading.Tasks;
7+
using System.Windows;
8+
9+
namespace LiffManager
10+
{
11+
/// <summary>
12+
/// App.xaml の相互作用ロジック
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}

LiffManager/LiffManager.csproj

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{48EC0A76-C311-4A20-9AC2-14CF655485C8}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<RootNamespace>LiffManager</RootNamespace>
10+
<AssemblyName>LiffManager</AssemblyName>
11+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14+
<WarningLevel>4</WarningLevel>
15+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18+
<PlatformTarget>AnyCPU</PlatformTarget>
19+
<DebugSymbols>true</DebugSymbols>
20+
<DebugType>full</DebugType>
21+
<Optimize>false</Optimize>
22+
<OutputPath>bin\Debug\</OutputPath>
23+
<DefineConstants>DEBUG;TRACE</DefineConstants>
24+
<ErrorReport>prompt</ErrorReport>
25+
<WarningLevel>4</WarningLevel>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28+
<PlatformTarget>AnyCPU</PlatformTarget>
29+
<DebugType>pdbonly</DebugType>
30+
<Optimize>true</Optimize>
31+
<OutputPath>bin\Release\</OutputPath>
32+
<DefineConstants>TRACE</DefineConstants>
33+
<ErrorReport>prompt</ErrorReport>
34+
<WarningLevel>4</WarningLevel>
35+
</PropertyGroup>
36+
<ItemGroup>
37+
<Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
38+
<HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
39+
</Reference>
40+
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
41+
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
42+
</Reference>
43+
<Reference Include="Prism, Version=6.3.0.0, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
44+
<HintPath>..\packages\Prism.Core.6.3.0\lib\net45\Prism.dll</HintPath>
45+
</Reference>
46+
<Reference Include="Prism.Wpf, Version=6.3.0.0, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
47+
<HintPath>..\packages\Prism.Wpf.6.3.0\lib\net45\Prism.Wpf.dll</HintPath>
48+
</Reference>
49+
<Reference Include="System" />
50+
<Reference Include="System.Data" />
51+
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
52+
<HintPath>..\packages\Prism.Wpf.6.3.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
53+
</Reference>
54+
<Reference Include="System.Xml" />
55+
<Reference Include="Microsoft.CSharp" />
56+
<Reference Include="System.Core" />
57+
<Reference Include="System.Xml.Linq" />
58+
<Reference Include="System.Data.DataSetExtensions" />
59+
<Reference Include="System.Net.Http" />
60+
<Reference Include="System.Xaml">
61+
<RequiredTargetFramework>4.0</RequiredTargetFramework>
62+
</Reference>
63+
<Reference Include="WindowsBase" />
64+
<Reference Include="PresentationCore" />
65+
<Reference Include="PresentationFramework" />
66+
</ItemGroup>
67+
<ItemGroup>
68+
<ApplicationDefinition Include="App.xaml">
69+
<Generator>MSBuild:Compile</Generator>
70+
<SubType>Designer</SubType>
71+
</ApplicationDefinition>
72+
<Page Include="MainWindow.xaml">
73+
<Generator>MSBuild:Compile</Generator>
74+
<SubType>Designer</SubType>
75+
</Page>
76+
<Compile Include="App.xaml.cs">
77+
<DependentUpon>App.xaml</DependentUpon>
78+
<SubType>Code</SubType>
79+
</Compile>
80+
<Compile Include="MainWindow.xaml.cs">
81+
<DependentUpon>MainWindow.xaml</DependentUpon>
82+
<SubType>Code</SubType>
83+
</Compile>
84+
</ItemGroup>
85+
<ItemGroup>
86+
<Compile Include="MainWindowViewModel.cs" />
87+
<Compile Include="Properties\AssemblyInfo.cs">
88+
<SubType>Code</SubType>
89+
</Compile>
90+
<Compile Include="Properties\Resources.Designer.cs">
91+
<AutoGen>True</AutoGen>
92+
<DesignTime>True</DesignTime>
93+
<DependentUpon>Resources.resx</DependentUpon>
94+
</Compile>
95+
<Compile Include="Properties\Settings.Designer.cs">
96+
<AutoGen>True</AutoGen>
97+
<DependentUpon>Settings.settings</DependentUpon>
98+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
99+
</Compile>
100+
<EmbeddedResource Include="Properties\Resources.resx">
101+
<Generator>ResXFileCodeGenerator</Generator>
102+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
103+
</EmbeddedResource>
104+
<None Include="packages.config" />
105+
<None Include="Properties\Settings.settings">
106+
<Generator>SettingsSingleFileGenerator</Generator>
107+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
108+
</None>
109+
</ItemGroup>
110+
<ItemGroup>
111+
<None Include="App.config" />
112+
</ItemGroup>
113+
<ItemGroup>
114+
<ProjectReference Include="..\Line.Messaging\Line.Messaging.csproj">
115+
<Project>{05d6b392-9e4f-4f35-b1f9-72f907d9c3d0}</Project>
116+
<Name>Line.Messaging</Name>
117+
</ProjectReference>
118+
</ItemGroup>
119+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
120+
</Project>

LiffManager/MainWindow.xaml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<Window x:Class="LiffManager.MainWindow"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:local="clr-namespace:LiffManager"
7+
xmlns:line="clr-namespace:Line.Messaging.Liff;assembly=Line.Messaging"
8+
xmlns:sys="clr-namespace:System;assembly=mscorlib"
9+
mc:Ignorable="d"
10+
Title="MainWindow" Height="450" Width="610.76">
11+
12+
<Window.Resources>
13+
<ObjectDataProvider x:Key="ViewTypeKey" MethodName="GetValues"
14+
ObjectType="{x:Type sys:Enum}">
15+
<ObjectDataProvider.MethodParameters>
16+
<x:Type TypeName="line:ViewType"/>
17+
</ObjectDataProvider.MethodParameters>
18+
</ObjectDataProvider>
19+
</Window.Resources>
20+
<Window.DataContext>
21+
<local:MainWindowViewModel/>
22+
</Window.DataContext>
23+
<Grid>
24+
<Grid.RowDefinitions>
25+
<RowDefinition Height="Auto"/>
26+
<RowDefinition Height="Auto"/>
27+
<RowDefinition Height="Auto"/>
28+
<RowDefinition Height="Auto"/>
29+
<RowDefinition Height="Auto"/>
30+
<RowDefinition Height="Auto"/>
31+
<RowDefinition Height="*"/>
32+
</Grid.RowDefinitions>
33+
34+
<Grid.ColumnDefinitions>
35+
<ColumnDefinition Width="Auto"/>
36+
<ColumnDefinition/>
37+
</Grid.ColumnDefinitions>
38+
39+
<TextBlock Grid.Row="0" Grid.Column="0" Margin="4,2"
40+
Text="Channel Access Token: "/>
41+
<TextBox Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" Margin="4,2"
42+
Text="{Binding ChannelAccessToken, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="400"/>
43+
44+
<TextBlock Grid.Row="1" Grid.Column="0" Margin="4,2"
45+
Text="View Type: "/>
46+
<ComboBox Grid.Row="1" Grid.Column="1" Width="200"
47+
HorizontalAlignment="Left" Margin="4,2"
48+
SelectedItem="{Binding SelectedViewType}"
49+
ItemsSource="{Binding Source={StaticResource ViewTypeKey}}"/>
50+
51+
<TextBlock Grid.Row="2" Grid.Column="0" Text="Site URL:" Margin="4,2"/>
52+
<TextBox Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" Margin="4,2"
53+
Text="{Binding SiteUrl, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="400"/>
54+
55+
<Button Grid.Row="3" Grid.ColumnSpan="2" HorizontalAlignment="Center" Padding="4,2" Margin="4,2"
56+
Command="{Binding AddLiffAppCommand}">
57+
Add LIFF App
58+
</Button>
59+
60+
<Separator Grid.Row="4" Grid.ColumnSpan="2" Height="16"/>
61+
<StackPanel Grid.Row="5" Grid.ColumnSpan="2" Orientation="Horizontal" >
62+
<Button Margin="4,2" Padding="4,2" Command="{Binding ListLiffAppsCommand}">List LIFF Apps</Button>
63+
<Button Margin="4,2" Padding="4,2" Command="{Binding DeleteLiffAppCommand}">Delete LIFF App</Button>
64+
<TextBlock Margin="12,2,4,2" Padding="4,2" Text="User ID"/>
65+
<TextBox Text="{Binding UserId}" Width="200"></TextBox>
66+
<Button Margin="4,2" Padding="4,2" Command="{Binding PushLinkMessageCommand}">Push to User</Button>
67+
</StackPanel>
68+
69+
<ListView Grid.Row="6" Grid.ColumnSpan="2" Margin="4,8" ItemsSource="{Binding LiffApps}" SelectedItem="{Binding SelectedLiffApp}">
70+
<ListView.ItemTemplate>
71+
<DataTemplate DataType="{x:Type line:LiffApp}">
72+
<StackPanel Orientation="Vertical">
73+
<TextBlock >
74+
<Run Text="ID: "/><Run Text="{Binding LiffId, Mode=OneWay}" FontSize="16" FontWeight="Bold"/><LineBreak/>
75+
<Run Text="View Type: "/><Run Text="{Binding View.Type, Mode=OneWay}"/><LineBreak/>
76+
<Run Text="URL: "/>
77+
<Hyperlink NavigateUri="{Binding View.Url}">
78+
<Run Text="{Binding View.Url, Mode=OneWay}"/>
79+
</Hyperlink>
80+
</TextBlock>
81+
</StackPanel>
82+
</DataTemplate>
83+
</ListView.ItemTemplate>
84+
</ListView>
85+
86+
</Grid>
87+
</Window>

LiffManager/MainWindow.xaml.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Windows;
7+
using System.Windows.Controls;
8+
using System.Windows.Data;
9+
using System.Windows.Documents;
10+
using System.Windows.Input;
11+
using System.Windows.Media;
12+
using System.Windows.Media.Imaging;
13+
using System.Windows.Navigation;
14+
using System.Windows.Shapes;
15+
16+
namespace LiffManager
17+
{
18+
/// <summary>
19+
/// MainWindow.xaml の相互作用ロジック
20+
/// </summary>
21+
public partial class MainWindow : Window
22+
{
23+
private MainWindowViewModel VM { get => DataContext as MainWindowViewModel; }
24+
public MainWindow()
25+
{
26+
InitializeComponent();
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)