Use line breaking and \n characters to make lines (because this is the character of a console). The console model I would make a class that contains a char and a Color (one dimensional). It determines where to start the display (while you have a look behind). Another DP would hold the top-left positon Location ( long). You ma prefer to derive from Control, but UserControl may have Content, so you can show something like a connection indicator icon inside.Īrchitecture-wise I'd suggest to create a dependecy property Buffer ( ConsoleBuffer) that holds the console buffer-model. Since WPF is backbuffered and you don't want to display an arbitrary bitmap the most likly approach would be to create a new UserControl and override it's Paint-Method. Therefore the better (or even right) approach is to "draw yourself". Holding it all in memory + drawing it.it will be incredibly slow. Just think of what has to happen if you want like 200x100 characters. Ellipses, Textblocks) is probably not a good Idea. Thus I am still looking for an existing implementation :-P I haven't done it myself, however it is one of my "I'll do it if I have time"-projects. Propert圜hanged(this, new Propert圜hangedEventArgs(propertyName)) Void OnPropert圜hanged(string propertyName) Public event Propert圜hangedEventHandler Propert圜hanged Public ObservableCollection ConsoleOutput ObservableCollection consoleOutput = new ObservableCollection() Public class ConsoleContent : INotifyPropert圜hanged Void InputBlock_KeyDown(object sender, KeyEventArgs e) InputBlock.KeyDown += InputBlock_KeyDown Void MainWindow_Loaded(object sender, RoutedEventArgs e) public partial class MainWindow : WindowĬonsoleContent dc = new ConsoleContent() Note that you'd have to handle the commands and outputting the results yourself. Given that you want to emulate a console, I'd do it like this.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |