Skip to content

Commit bfd07bf

Browse files
author
a.hosseini
committed
.
1 parent 7e1a4e6 commit bfd07bf

12 files changed

+74
-53
lines changed

fast cf ip scanner/AppShell.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ public AppShell()
88
{
99
InitializeComponent();
1010
Routing.RegisterRoute(nameof(SettingPage), typeof(SettingPage));
11+
Routing.RegisterRoute(nameof(IpOptionsPage), typeof(IpOptionsPage));
1112
}
1213
}

fast cf ip scanner/MauiProgram.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ public static MauiApp CreateMauiApp()
2323

2424
builder.Services.AddSingleton<SettingPage>();
2525

26+
builder.Services.AddSingleton<IpOptionsPage>();
27+
2628
#endregion
2729

2830
#region ViewModels
@@ -31,6 +33,8 @@ public static MauiApp CreateMauiApp()
3133

3234
builder.Services.AddSingleton<SettingViewModel>();
3335

36+
builder.Services.AddSingleton<IpOptionViewModel>();
37+
3438
#endregion
3539

3640
#region Services

fast cf ip scanner/ViewModels/BaseViewModel.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,5 @@ namespace fast_cf_ip_scanner.ViewModels
88
{
99
public partial class BaseViewModel : ObservableObject
1010
{
11-
public BaseViewModel()
12-
{
13-
}
1411
}
1512
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+

2+
using System.ComponentModel;
3+
4+
namespace fast_cf_ip_scanner.ViewModels;
5+
6+
7+
[QueryProperty("IpOptions", "IpOptions")]
8+
9+
public partial class IpOptionViewModel : BaseViewModel
10+
{
11+
[ObservableProperty]
12+
IpOptionModel _ipOptions;
13+
14+
15+
16+
17+
18+
}

fast cf ip scanner/ViewModels/ScanPageViewModel.cs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11

2-
using AndroidX.Navigation.Fragment;
3-
using CommunityToolkit.Mvvm.Input;
42
using fast_cf_ip_scanner.Views;
5-
using Microsoft.Maui.ApplicationModel.DataTransfer;
6-
using Microsoft.Maui.Controls;
73

84
namespace fast_cf_ip_scanner.ViewModels
95
{
@@ -72,11 +68,21 @@ async void GetValidIPs()
7268

7369

7470
}
71+
72+
[RelayCommand]
73+
async Task ShowOptionsForSearchIp()
74+
{
75+
await Shell.Current.GoToAsync($"{nameof(IpOptionsPage)}", new Dictionary<string, object>
76+
{
77+
{"IpOptions",_ipOption},
78+
});
79+
}
80+
7581
int ConvertMaxPingOfIPToInt(string maxPing)
7682
{
7783
if (maxPing == null)
7884
{
79-
return 5000;
85+
return 1000;
8086
}
8187
else
8288
{
@@ -86,17 +92,10 @@ int ConvertMaxPingOfIPToInt(string maxPing)
8692
}
8793
catch
8894
{
89-
return 5000;
95+
return 1000;
9096
}
9197
}
92-
9398
}
94-
[RelayCommand]
95-
async Task ShowOptionsForSearchIp()
96-
{
97-
98-
}
99-
10099

101100
[RelayCommand]
102101
async Task ShowSelectedIPOption(IPModel ipModel)

fast cf ip scanner/Views/IpOptions.xaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

fast cf ip scanner/Views/IpOptions.xaml.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
x:Class="fast_cf_ip_scanner.Views.IpOptionsPage"
5+
Title="IpOptions"
6+
xmlns:viewmodel="clr-namespace:fast_cf_ip_scanner.ViewModels"
7+
x:DataType="viewmodel:IpOptionViewModel">
8+
<StackLayout Padding="20">
9+
<Label Text="Ports:"/>
10+
<Picker x:Name="PortsPicker" ItemsSource="{Binding IpOptions.Ports}"/>
11+
12+
<Label Text="Max Ping of IP:"/>
13+
<Entry x:Name="MaxPingEntry" Text="{Binding IpOptions.MaxPingOfIP}"/>
14+
15+
<Label Text="Minimum Count of Valid IP:"/>
16+
<Entry x:Name="MinCountEntry" Text="{Binding IpOptions.MinimumCountOfValidIp}"/>
17+
18+
<Label Text="Count of Repeat Test for Each IP:"/>
19+
<Entry x:Name="RepeatCountEntry" Text="{Binding IpOptions.CountOfRepeatTestForEachIp}"/>
20+
</StackLayout>
21+
</ContentPage>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace fast_cf_ip_scanner.Views;
2+
3+
public partial class IpOptionsPage : ContentPage
4+
{
5+
6+
public IpOptionsPage(IpOptionViewModel viewModel)
7+
{
8+
InitializeComponent();
9+
BindingContext = viewModel;
10+
}
11+
}

fast cf ip scanner/Views/ScanPage.xaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
HorizontalOptions="Center"
5050
SelectionChangedCommand="{Binding ShowSelectedIPOptionCommand}"
5151
SelectionChangedCommandParameter="{Binding Source={x:Reference validIPCollectionView}, Path=SelectedItem}"
52-
SelectionMode="Single"
52+
SelectionMode="None"
5353
IsVisible="{Binding IsBusy, Converter={StaticResource InverseBooleanConverter}}">
5454
<CollectionView.ItemTemplate>
5555
<DataTemplate x:DataType="model:IPModel">
@@ -63,7 +63,6 @@
6363
<RowDefinition Height="Auto" />
6464
<RowDefinition Height="Auto" />
6565
</Grid.RowDefinitions>
66-
6766
<Label Grid.Row="0" Grid.Column="0" Text="ip :" TextColor="White" />
6867
<Label Grid.Row="0" Grid.Column="1" Text="{Binding IP}" TextColor="White" />
6968

@@ -75,7 +74,6 @@
7574
</Grid>
7675
</DataTemplate>
7776
</CollectionView.ItemTemplate>
78-
7977
</CollectionView>
8078

8179
<ActivityIndicator IsRunning="{Binding IsBusy}" IsVisible="{Binding IsBusy}" />

0 commit comments

Comments
 (0)