pxd 丝
pxd 丝
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
With events you can avoid it and I think that's the point you're telling
104 replies
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
Same when I manipulate any property I guess
104 replies
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
As the state just changed
104 replies
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
In this case, the tree will be reloaded
104 replies
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
Save only happens when you save the file
104 replies
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
Read only happens when you load the file
104 replies
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
That's by design
104 replies
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
I'd prefer not binding the Read to the Ctor as I'd need to have empty defaults
104 replies
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
And I'd not mix the ViewModel here for cleanness sake
104 replies
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
In that sense the models are straightforward
104 replies
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
Then each chunk derived type implements that and the properties:
public class ChunkHeader
{
public uint Size = 0;
public ChunkType Type = ChunkType.Unknown;
public uint Version = 0;

private void Read(BinaryReader fileAccess)
{
Type = (ChunkType)fileAccess.ReadUInt32();
Size = fileAccess.ReadUInt32();
Version = fileAccess.ReadUInt32();
}

private void Write(BinaryWriter fileAccess)
{
fileAccess.Write((uint)Type);
fileAccess.Write(Size);
fileAccess.Write(Version);
}
...
}
public class ChunkHeader
{
public uint Size = 0;
public ChunkType Type = ChunkType.Unknown;
public uint Version = 0;

private void Read(BinaryReader fileAccess)
{
Type = (ChunkType)fileAccess.ReadUInt32();
Size = fileAccess.ReadUInt32();
Version = fileAccess.ReadUInt32();
}

private void Write(BinaryWriter fileAccess)
{
fileAccess.Write((uint)Type);
fileAccess.Write(Size);
fileAccess.Write(Version);
}
...
}
104 replies
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
public interface IBinaryReadWrite
{
public void Read(BinaryReader binaryReader);
public void Write(BinaryWriter binaryWriter);
}
public interface IBinaryReadWrite
{
public void Read(BinaryReader binaryReader);
public void Write(BinaryWriter binaryWriter);
}
104 replies
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
Right now the data classes are just implementing IBinaryReadWrite:
104 replies
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
I'd probably not bind the data to the view directly
104 replies
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
In the future I want to extract the "Chunk" stuff to a library so it can be reused later
104 replies
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
Now I gotta find out how to do the XAML part
104 replies
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
I see
104 replies
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
Do I need to derive from a base class and attach Interfaces?
104 replies
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
How would I start? Implementing my own TreeViewItem with a "ChunkTreeViewItem" type?
104 replies
CC#
Created by pxd 丝 on 1/25/2024 in #help
How could I implement the tree correctly using XAML?
That's the dynamic aspect here
104 replies