WPF - Bindable chat view with selectable text
up vote
2
down vote
favorite
WPF - Bindable chat view with selectable text
I want to create a simple text chat app using WPF. And of course user should be able to select and, for example, copy text.
It's very easy to use, for example, ListView with ItemsSource bound to messages. And appearance can be tuned, but the main problem is text selection. It's possible to select text only in one single control (one message).
At the moment i use WebBrowser for showing messages. So i have tons of HTML+JS+CSS. I think i dont even have to say how terrible it is.
Can you please point me to right direction?
c# .net wpf user-interface
add a comment |
up vote
2
down vote
favorite
WPF - Bindable chat view with selectable text
I want to create a simple text chat app using WPF. And of course user should be able to select and, for example, copy text.
It's very easy to use, for example, ListView with ItemsSource bound to messages. And appearance can be tuned, but the main problem is text selection. It's possible to select text only in one single control (one message).
At the moment i use WebBrowser for showing messages. So i have tons of HTML+JS+CSS. I think i dont even have to say how terrible it is.
Can you please point me to right direction?
c# .net wpf user-interface
Are you looking for a control that gives text selection? Like a RichTextBox? Or do you want an automatic touch message and copy to clipboard? Can you post some of your code?
– Clayton Harbich
Nov 14 at 22:30
The OP wants to be able to select text from one item control item template, and have the selection span to another item, by dragging the mouse to select like you would in slack, or teams.
– Michael G
Nov 14 at 22:31
@ClaytonHarbich, i have no code, because i have no idea how to do it. that's why i'm here:) Michael is right - i want a control,with which i will be able to drug mouse over content to select everything i need. like in any other messangers.
– Sam Sch
Nov 15 at 6:18
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
WPF - Bindable chat view with selectable text
I want to create a simple text chat app using WPF. And of course user should be able to select and, for example, copy text.
It's very easy to use, for example, ListView with ItemsSource bound to messages. And appearance can be tuned, but the main problem is text selection. It's possible to select text only in one single control (one message).
At the moment i use WebBrowser for showing messages. So i have tons of HTML+JS+CSS. I think i dont even have to say how terrible it is.
Can you please point me to right direction?
c# .net wpf user-interface
WPF - Bindable chat view with selectable text
I want to create a simple text chat app using WPF. And of course user should be able to select and, for example, copy text.
It's very easy to use, for example, ListView with ItemsSource bound to messages. And appearance can be tuned, but the main problem is text selection. It's possible to select text only in one single control (one message).
At the moment i use WebBrowser for showing messages. So i have tons of HTML+JS+CSS. I think i dont even have to say how terrible it is.
Can you please point me to right direction?
c# .net wpf user-interface
c# .net wpf user-interface
asked Nov 14 at 22:10
Sam Sch
1559
1559
Are you looking for a control that gives text selection? Like a RichTextBox? Or do you want an automatic touch message and copy to clipboard? Can you post some of your code?
– Clayton Harbich
Nov 14 at 22:30
The OP wants to be able to select text from one item control item template, and have the selection span to another item, by dragging the mouse to select like you would in slack, or teams.
– Michael G
Nov 14 at 22:31
@ClaytonHarbich, i have no code, because i have no idea how to do it. that's why i'm here:) Michael is right - i want a control,with which i will be able to drug mouse over content to select everything i need. like in any other messangers.
– Sam Sch
Nov 15 at 6:18
add a comment |
Are you looking for a control that gives text selection? Like a RichTextBox? Or do you want an automatic touch message and copy to clipboard? Can you post some of your code?
– Clayton Harbich
Nov 14 at 22:30
The OP wants to be able to select text from one item control item template, and have the selection span to another item, by dragging the mouse to select like you would in slack, or teams.
– Michael G
Nov 14 at 22:31
@ClaytonHarbich, i have no code, because i have no idea how to do it. that's why i'm here:) Michael is right - i want a control,with which i will be able to drug mouse over content to select everything i need. like in any other messangers.
– Sam Sch
Nov 15 at 6:18
Are you looking for a control that gives text selection? Like a RichTextBox? Or do you want an automatic touch message and copy to clipboard? Can you post some of your code?
– Clayton Harbich
Nov 14 at 22:30
Are you looking for a control that gives text selection? Like a RichTextBox? Or do you want an automatic touch message and copy to clipboard? Can you post some of your code?
– Clayton Harbich
Nov 14 at 22:30
The OP wants to be able to select text from one item control item template, and have the selection span to another item, by dragging the mouse to select like you would in slack, or teams.
– Michael G
Nov 14 at 22:31
The OP wants to be able to select text from one item control item template, and have the selection span to another item, by dragging the mouse to select like you would in slack, or teams.
– Michael G
Nov 14 at 22:31
@ClaytonHarbich, i have no code, because i have no idea how to do it. that's why i'm here:) Michael is right - i want a control,with which i will be able to drug mouse over content to select everything i need. like in any other messangers.
– Sam Sch
Nov 15 at 6:18
@ClaytonHarbich, i have no code, because i have no idea how to do it. that's why i'm here:) Michael is right - i want a control,with which i will be able to drug mouse over content to select everything i need. like in any other messangers.
– Sam Sch
Nov 15 at 6:18
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
A textbox should give you what you are looking for I think. You will need to do the styling so it looks like you want but here is code:
XAML:
<TextBox Text="{Binding AllMessages}"/>
ViewModel:
public IEnumerable<string> Messages { get; set; }
public string AllMessages => GetAllMessages();
private string GetAllMessages()
{
var builder = new StringBuilder();
foreach (var message in Messages)
{
//Add in whatever for context
builder.AppendLine(message);
}
return builder.ToString();
}
You will probably want to use a RichTextBox for better formatting.
please read my question carefully. ListView does not work. in this case i able to select only one message. i cant press mouse button and drug it over all messages to select them all. i described it in my question.
– Sam Sch
Nov 15 at 17:17
Updated answer.
– Clayton Harbich
Nov 15 at 22:56
thanks for your time, but this is extremely dirty solution for many reasons.
– Sam Sch
Nov 16 at 9:14
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
A textbox should give you what you are looking for I think. You will need to do the styling so it looks like you want but here is code:
XAML:
<TextBox Text="{Binding AllMessages}"/>
ViewModel:
public IEnumerable<string> Messages { get; set; }
public string AllMessages => GetAllMessages();
private string GetAllMessages()
{
var builder = new StringBuilder();
foreach (var message in Messages)
{
//Add in whatever for context
builder.AppendLine(message);
}
return builder.ToString();
}
You will probably want to use a RichTextBox for better formatting.
please read my question carefully. ListView does not work. in this case i able to select only one message. i cant press mouse button and drug it over all messages to select them all. i described it in my question.
– Sam Sch
Nov 15 at 17:17
Updated answer.
– Clayton Harbich
Nov 15 at 22:56
thanks for your time, but this is extremely dirty solution for many reasons.
– Sam Sch
Nov 16 at 9:14
add a comment |
up vote
0
down vote
A textbox should give you what you are looking for I think. You will need to do the styling so it looks like you want but here is code:
XAML:
<TextBox Text="{Binding AllMessages}"/>
ViewModel:
public IEnumerable<string> Messages { get; set; }
public string AllMessages => GetAllMessages();
private string GetAllMessages()
{
var builder = new StringBuilder();
foreach (var message in Messages)
{
//Add in whatever for context
builder.AppendLine(message);
}
return builder.ToString();
}
You will probably want to use a RichTextBox for better formatting.
please read my question carefully. ListView does not work. in this case i able to select only one message. i cant press mouse button and drug it over all messages to select them all. i described it in my question.
– Sam Sch
Nov 15 at 17:17
Updated answer.
– Clayton Harbich
Nov 15 at 22:56
thanks for your time, but this is extremely dirty solution for many reasons.
– Sam Sch
Nov 16 at 9:14
add a comment |
up vote
0
down vote
up vote
0
down vote
A textbox should give you what you are looking for I think. You will need to do the styling so it looks like you want but here is code:
XAML:
<TextBox Text="{Binding AllMessages}"/>
ViewModel:
public IEnumerable<string> Messages { get; set; }
public string AllMessages => GetAllMessages();
private string GetAllMessages()
{
var builder = new StringBuilder();
foreach (var message in Messages)
{
//Add in whatever for context
builder.AppendLine(message);
}
return builder.ToString();
}
You will probably want to use a RichTextBox for better formatting.
A textbox should give you what you are looking for I think. You will need to do the styling so it looks like you want but here is code:
XAML:
<TextBox Text="{Binding AllMessages}"/>
ViewModel:
public IEnumerable<string> Messages { get; set; }
public string AllMessages => GetAllMessages();
private string GetAllMessages()
{
var builder = new StringBuilder();
foreach (var message in Messages)
{
//Add in whatever for context
builder.AppendLine(message);
}
return builder.ToString();
}
You will probably want to use a RichTextBox for better formatting.
edited Nov 15 at 21:30
answered Nov 15 at 17:09
Clayton Harbich
233313
233313
please read my question carefully. ListView does not work. in this case i able to select only one message. i cant press mouse button and drug it over all messages to select them all. i described it in my question.
– Sam Sch
Nov 15 at 17:17
Updated answer.
– Clayton Harbich
Nov 15 at 22:56
thanks for your time, but this is extremely dirty solution for many reasons.
– Sam Sch
Nov 16 at 9:14
add a comment |
please read my question carefully. ListView does not work. in this case i able to select only one message. i cant press mouse button and drug it over all messages to select them all. i described it in my question.
– Sam Sch
Nov 15 at 17:17
Updated answer.
– Clayton Harbich
Nov 15 at 22:56
thanks for your time, but this is extremely dirty solution for many reasons.
– Sam Sch
Nov 16 at 9:14
please read my question carefully. ListView does not work. in this case i able to select only one message. i cant press mouse button and drug it over all messages to select them all. i described it in my question.
– Sam Sch
Nov 15 at 17:17
please read my question carefully. ListView does not work. in this case i able to select only one message. i cant press mouse button and drug it over all messages to select them all. i described it in my question.
– Sam Sch
Nov 15 at 17:17
Updated answer.
– Clayton Harbich
Nov 15 at 22:56
Updated answer.
– Clayton Harbich
Nov 15 at 22:56
thanks for your time, but this is extremely dirty solution for many reasons.
– Sam Sch
Nov 16 at 9:14
thanks for your time, but this is extremely dirty solution for many reasons.
– Sam Sch
Nov 16 at 9:14
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53309494%2fwpf-bindable-chat-view-with-selectable-text%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Are you looking for a control that gives text selection? Like a RichTextBox? Or do you want an automatic touch message and copy to clipboard? Can you post some of your code?
– Clayton Harbich
Nov 14 at 22:30
The OP wants to be able to select text from one item control item template, and have the selection span to another item, by dragging the mouse to select like you would in slack, or teams.
– Michael G
Nov 14 at 22:31
@ClaytonHarbich, i have no code, because i have no idea how to do it. that's why i'm here:) Michael is right - i want a control,with which i will be able to drug mouse over content to select everything i need. like in any other messangers.
– Sam Sch
Nov 15 at 6:18