开发者

e.DetailsElement in silverlight

is there any way i can write this code in a function() right now what is happening in function is

it tells e.Row.DetailsVisibility

e.DetailsElement.ActualHeight

it is not able to find this it is telling is there any way i can get this e.DetailsElement.ActualHeight

if (e.Row.DetailsVisibility == Visibility.Visible)
            {
                Dispatcher.BeginInvoke(() =>
                {
                    DataGrid datagrid = sender as DataGrid;
                    if (datagrid != null)
                    {
                        datagrid.Tag = e.DetailsElement.ActualHeight;
                        datagrid.Height = datagrid.ActualHeight + e.DetailsElement.ActualHeight;
                    }
                }
                );
            }
            else
            {
                DataGrid datagrid = sender as DataGrid;
                if(datagrid.Tag!=null)
                    datagrid.Height = datagrid.ActualHeight - System.Convert.ToDoubl开发者_StackOverflow社区e(datagrid.Tag);

            }
        }


Having in mind that you explanation is not very clear, what's the problem to put that code in a function as follows:

public void yourFunction(object sender, theTypeOfArguments e )
{
    if (e.Row.DetailsVisibility == Visibility.Visible)
    {
        Dispatcher.BeginInvoke(() =>
        {
            DataGrid datagrid = sender as DataGrid;
            if (datagrid != null)
            {
                datagrid.Tag = e.DetailsElement.ActualHeight;
                datagrid.Height = datagrid.ActualHeight + e.DetailsElement.ActualHeight;
            }
        }
        );
    }
    else
    {
        DataGrid datagrid = sender as DataGrid;
        if(datagrid.Tag!=null)
            datagrid.Height = datagrid.ActualHeight - System.Convert.ToDouble(datagrid.Tag);

    }
}

If that's not your question please give more clarifications.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜