iskander
iskander
CC#
Created by iskander on 1/19/2024 in #help
✅ (Avalonia) i dont get data binding
oh thanks for the heads up!
7 replies
CC#
Created by iskander on 1/19/2024 in #help
✅ (Avalonia) i dont get data binding
nvm my issue was my stupidity XD forgot to set the data context of the window in the app.axaml.cs file
desktop.MainWindow = new MainWindow
{
DataContext = new MainWindowViewModel()
};
desktop.MainWindow = new MainWindow
{
DataContext = new MainWindowViewModel()
};
7 replies
CC#
Created by iskander on 1/19/2024 in #help
✅ (Avalonia) i dont get data binding
//ToDoListView.axaml
<UserControl //boiler plate stff
x:Class="testAvaloniaApplication1.Views.ToDoListView"
x:DataType="vm:ToDoListViewModel">
<DockPanel>
<Button DockPanel.Dock="Bottom"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center"
Content="Add an item"/>
<ItemsControl ItemsSource="{Binding ListItems}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<CheckBox Margin="4"
IsChecked="{Binding IsChecked}"
Content="{Binding Description}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DockPanel>
</UserControl>
//ToDoListView.axaml
<UserControl //boiler plate stff
x:Class="testAvaloniaApplication1.Views.ToDoListView"
x:DataType="vm:ToDoListViewModel">
<DockPanel>
<Button DockPanel.Dock="Bottom"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center"
Content="Add an item"/>
<ItemsControl ItemsSource="{Binding ListItems}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<CheckBox Margin="4"
IsChecked="{Binding IsChecked}"
Content="{Binding Description}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DockPanel>
</UserControl>
using testAvaloniaApplication1.DataModels;

namespace testAvaloniaApplication1.ViewModels
{
public class MainWindowViewModel : ViewModelBase
{
//Depends on ToDoListServices
public ToDoListViewModel ToDoList { get; }
public MainWindowViewModel()
{
var service = new ToDoListService();
ToDoList = new ToDoListViewModel(service.GetItems());
}
}
}
using testAvaloniaApplication1.DataModels;

namespace testAvaloniaApplication1.ViewModels
{
public class MainWindowViewModel : ViewModelBase
{
//Depends on ToDoListServices
public ToDoListViewModel ToDoList { get; }
public MainWindowViewModel()
{
var service = new ToDoListService();
ToDoList = new ToDoListViewModel(service.GetItems());
}
}
}
using System.Collections.Generic;
using System.Collections.ObjectModel;
using testAvaloniaApplication1.DataModels;

namespace testAvaloniaApplication1.ViewModels;

public class ToDoListViewModel : ViewModelBase
{
public ObservableCollection<ToDoItem> ListItems { get; set; }
public ToDoListViewModel(IEnumerable<ToDoItem> items)
{
ListItems = new ObservableCollection<ToDoItem>(items);
}
}
using System.Collections.Generic;
using System.Collections.ObjectModel;
using testAvaloniaApplication1.DataModels;

namespace testAvaloniaApplication1.ViewModels;

public class ToDoListViewModel : ViewModelBase
{
public ObservableCollection<ToDoItem> ListItems { get; set; }
public ToDoListViewModel(IEnumerable<ToDoItem> items)
{
ListItems = new ObservableCollection<ToDoItem>(items);
}
}
7 replies
CC#
Created by iskander on 8/8/2023 in #help
✅ TcpClient is connected to TcpListener but TcpListener isn't connected...
i just checked and the remote client is indeed connected. i appreciate your help 🙏
26 replies
CC#
Created by iskander on 8/8/2023 in #help
✅ TcpClient is connected to TcpListener but TcpListener isn't connected...
yep that's probably it! thanks a lot kouhai 😅
26 replies
CC#
Created by iskander on 8/8/2023 in #help
✅ TcpClient is connected to TcpListener but TcpListener isn't connected...
oh yeah that makes sense! the tcplisten cant be connected to it's own socket
26 replies
CC#
Created by iskander on 8/8/2023 in #help
✅ TcpClient is connected to TcpListener but TcpListener isn't connected...
hmmm but dont you need both sockets to be connected to send information?
26 replies
CC#
Created by iskander on 8/8/2023 in #help
✅ TcpClient is connected to TcpListener but TcpListener isn't connected...
so yeah connected is still false 🫤
26 replies
CC#
Created by iskander on 8/8/2023 in #help
✅ TcpClient is connected to TcpListener but TcpListener isn't connected...
26 replies
CC#
Created by iskander on 8/8/2023 in #help
✅ TcpClient is connected to TcpListener but TcpListener isn't connected...
just a sec 😅
26 replies
CC#
Created by iskander on 8/8/2023 in #help
✅ TcpClient is connected to TcpListener but TcpListener isn't connected...
and i doxxed my self...cool
26 replies
CC#
Created by iskander on 8/8/2023 in #help
✅ TcpClient is connected to TcpListener but TcpListener isn't connected...
i'll test rq. can i ping you back when something comes up?
26 replies
CC#
Created by iskander on 8/8/2023 in #help
✅ TcpClient is connected to TcpListener but TcpListener isn't connected...
hmmm ig that makes sense
26 replies
CC#
Created by iskander on 8/8/2023 in #help
✅ TcpClient is connected to TcpListener but TcpListener isn't connected...
while already accepted clients remain connected
26 replies
CC#
Created by iskander on 8/8/2023 in #help
✅ TcpClient is connected to TcpListener but TcpListener isn't connected...
oh i thought that would only block any outside connection attempts
26 replies
CC#
Created by iskander on 8/8/2023 in #help
✅ TcpClient is connected to TcpListener but TcpListener isn't connected...
tbf i should've took a screenshot when i saw that 😅
26 replies
CC#
Created by iskander on 8/8/2023 in #help
✅ TcpClient is connected to TcpListener but TcpListener isn't connected...
even an error is thrown when i try to use NetworkStream.write about socket not being connected
26 replies
CC#
Created by iskander on 8/8/2023 in #help
✅ TcpClient is connected to TcpListener but TcpListener isn't connected...
which prevents me from sending data to clients
26 replies
CC#
Created by iskander on 8/8/2023 in #help
✅ TcpClient is connected to TcpListener but TcpListener isn't connected...
TcpListen.server.conneced is false
26 replies
CC#
Created by iskander on 8/8/2023 in #help
✅ TcpClient is connected to TcpListener but TcpListener isn't connected...
nope it returns a valid TcpClient
26 replies