Click here to Skip to main content
15,792,510 members
Home / Discussions / C#
   

C#

 
GeneralRe: Creating An Async Method Pin
Kevin Marois8-Oct-21 10:46
professionalKevin Marois8-Oct-21 10:46 
GeneralRe: Creating An Async Method Pin
lmoelleb9-Oct-21 1:18
lmoelleb9-Oct-21 1:18 
GeneralRe: Creating An Async Method Pin
Kevin Marois9-Oct-21 8:03
professionalKevin Marois9-Oct-21 8:03 
GeneralRe: Creating An Async Method Pin
lmoelleb10-Oct-21 9:56
lmoelleb10-Oct-21 9:56 
Question(xaml, wpf) ScrollViewer Binding confusion (beginner) (ANSWERED) Pin
Maximilien6-Oct-21 10:50
Maximilien6-Oct-21 10:50 
SuggestionRe: (xaml, wpf) ScrollViewer Binding confusion (beginner) Pin
Richard MacCutchan6-Oct-21 22:30
mveRichard MacCutchan6-Oct-21 22:30 
GeneralRe: (xaml, wpf) ScrollViewer Binding confusion (beginner) Pin
Maximilien7-Oct-21 4:49
Maximilien7-Oct-21 4:49 
AnswerRe: (xaml, wpf) ScrollViewer Binding confusion (beginner) Pin
Richard Deeming6-Oct-21 22:45
mveRichard Deeming6-Oct-21 22:45 
The sender parameter should be the ItemsControl, in which case you just need to walk up the visual tree to find the ScrollViewer.
C#
private void Containers_OnTargetUpdated(object? sender, DataTransferEventArgs e)
{
    var current = sender as DependencyObject;
    var scroller = current as ScrollViewer;
    while (scroller == null && current != null)
    {
        current = VisualTreeHelper.GetParent(current);
        scroller = current as ScrollViewer;
    }
    if (scroller != null)
    {
        scroller.ScrollToHome();
    }
}




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: (xaml, wpf) ScrollViewer Binding confusion (beginner) Pin
Maximilien8-Oct-21 4:03
Maximilien8-Oct-21 4:03 
QuestionCan't catch NullReferenceException while explicitly defined for that Pin
Exoskeletor2-Oct-21 0:03
Exoskeletor2-Oct-21 0:03 
AnswerRe: Can't catch NullReferenceException while explicitly defined for that Pin
Pete O'Hanlon2-Oct-21 0:38
subeditorPete O'Hanlon2-Oct-21 0:38 
AnswerRe: Can't catch NullReferenceException while explicitly defined for that Pin
OriginalGriff2-Oct-21 1:33
mvaOriginalGriff2-Oct-21 1:33 
JokeRe: Can't catch NullReferenceException while explicitly defined for that Pin
Pete O'Hanlon2-Oct-21 2:32
subeditorPete O'Hanlon2-Oct-21 2:32 
GeneralRe: Can't catch NullReferenceException while explicitly defined for that Pin
OriginalGriff2-Oct-21 3:14
mvaOriginalGriff2-Oct-21 3:14 
GeneralRe: Can't catch NullReferenceException while explicitly defined for that Pin
Exoskeletor2-Oct-21 4:01
Exoskeletor2-Oct-21 4:01 
GeneralRe: Can't catch NullReferenceException while explicitly defined for that Pin
Pete O'Hanlon2-Oct-21 4:51
subeditorPete O'Hanlon2-Oct-21 4:51 
GeneralRe: Can't catch NullReferenceException while explicitly defined for that Pin
OriginalGriff2-Oct-21 4:55
mvaOriginalGriff2-Oct-21 4:55 
GeneralRe: Can't catch NullReferenceException while explicitly defined for that Pin
Exoskeletor2-Oct-21 4:58
Exoskeletor2-Oct-21 4:58 
GeneralRe: Can't catch NullReferenceException while explicitly defined for that Pin
Exoskeletor2-Oct-21 3:58
Exoskeletor2-Oct-21 3:58 
AnswerRe: Can't catch NullReferenceException while explicitly defined for that Pin
Pete O'Hanlon3-Oct-21 21:22
subeditorPete O'Hanlon3-Oct-21 21:22 
GeneralRe: Can't catch NullReferenceException while explicitly defined for that Pin
Exoskeletor4-Oct-21 1:21
Exoskeletor4-Oct-21 1:21 
Questionhow read file from Open with in C# Pin
Member 1522978130-Sep-21 7:24
Member 1522978130-Sep-21 7:24 
AnswerRe: how read file from Open with in C# Pin
Dave Kreskowiak30-Sep-21 9:08
mveDave Kreskowiak30-Sep-21 9:08 
AnswerRe: how read file from Open with in C# Pin
Luc Pattyn30-Sep-21 9:30
sitebuilderLuc Pattyn30-Sep-21 9:30 
QuestionQuestion About Async Pin
Kevin Marois29-Sep-21 11:21
professionalKevin Marois29-Sep-21 11:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.