How to set DialogFragment size in Xamarin?
<p>I'am trying to set size of custom DialogFragment. I was trying something like this:</p>

<pre><code>class ChannelEdit : DialogFragment
{
    public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    {
        base.OnCreateView(inflater, container, savedInstanceState);
        var view = inflater.Inflate(Resource.Layout.ChannelEdit, container, false);
        DisplayMetrics dm = new DisplayMetrics();
        this.Dialog.Window.WindowManager.DefaultDisplay.GetMetrics(dm);
        int width = dm.WidthPixels;
        int height = dm.HeightPixels;
        this.Dialog.Window.SetLayout((int)width / 2, (int)height / 2);   
        return view;
    }
}
</code></pre>

<p>But Its not working. I'am not receiving any errors. Could You help me with this?</p>