Philip
Philip
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
Promise you this is toture for me 😂
136 replies
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
Sorry, Still available?
136 replies
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
It's still this.
136 replies
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
But it still doesn't show the selected item... 🤔
136 replies
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
Where is this supposed to go?
136 replies
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
136 replies
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
Easier said than done... 😅 Can I share the whole project in an easy way?
136 replies
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
I can share the whole thing.
136 replies
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
Sure
136 replies
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
Me included. 😅
136 replies
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
No description
136 replies
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
This right?
136 replies
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
Uhm I'm completely lost again 😂 How do I implement it now?
public ProtectionViewModel()
{
Servers = new ObservableCollection<ServerModel>();
{
Servers.Add(new ServerModel
{
Country = "Germany",
Image = "https://tse2.mm.bing.net/th?id=OIP.xp_gP4N6JVcGfHcGVr7acgHaD6",
Config = "--config ./VPN/de-udp6.ovpn"
});
Servers.Add(new ServerModel
{
Country = "United States",
Image = "https://upload.wikimedia.org/wikipedia/en/thumb/a/a4/Flag_of_the_United_States.svg/2560px-Flag_of_the_United_States.svg.png",
Config = "--config ./VPN/us-udp6.ovpn"
});
}

ConnectCommand = new RelayCommand(o =>
{

ConnectionStatus = "Connecting...";
var process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = @"C:\Program Files\OpenVPN\bin\openvpn.exe";
startInfo.Arguments = "--config ./VPN/de-udp6.ovpn";
startInfo.Verb = "runas";
startInfo.UseShellExecute = true;
process.StartInfo = startInfo;
process.Start();
process.WaitForExit();
ConnectionStatus = "Connected";
ShowSelectedItem();

});
}
public ProtectionViewModel()
{
Servers = new ObservableCollection<ServerModel>();
{
Servers.Add(new ServerModel
{
Country = "Germany",
Image = "https://tse2.mm.bing.net/th?id=OIP.xp_gP4N6JVcGfHcGVr7acgHaD6",
Config = "--config ./VPN/de-udp6.ovpn"
});
Servers.Add(new ServerModel
{
Country = "United States",
Image = "https://upload.wikimedia.org/wikipedia/en/thumb/a/a4/Flag_of_the_United_States.svg/2560px-Flag_of_the_United_States.svg.png",
Config = "--config ./VPN/us-udp6.ovpn"
});
}

ConnectCommand = new RelayCommand(o =>
{

ConnectionStatus = "Connecting...";
var process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = @"C:\Program Files\OpenVPN\bin\openvpn.exe";
startInfo.Arguments = "--config ./VPN/de-udp6.ovpn";
startInfo.Verb = "runas";
startInfo.UseShellExecute = true;
process.StartInfo = startInfo;
process.Start();
process.WaitForExit();
ConnectionStatus = "Connected";
ShowSelectedItem();

});
}
I want it to check which country is selected and then change the
startInfo.Arguments = "--config ./VPN/de-udp6.ovpn";
startInfo.Arguments = "--config ./VPN/de-udp6.ovpn";
dependent on the Item selected.
136 replies
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
So I can use the Binding from inside the Server Model now?
136 replies
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
Ah okay
136 replies
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
Okay
136 replies
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
Nvm 😅
136 replies
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
No description
136 replies
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
So I would need a variable in here?
136 replies
CC#
Created by Philip on 10/4/2023 in #help
✅ Working on a WPF Project, how can I get what StackPanel is selected?
I know what that means. ;)
136 replies